Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-05-04 18:38:56


Nicola Musatti wrote:
> Peter Dimov wrote:
>> Sorry for not following the thread properly, just a quick note:
>>
>>>>> (e.g. serialization support for core libraries should be supplied
>>>>> by serialization and not core [as I believe it is now, at least
>>>>> in many cases]).
>>
>> This is not right. Serialization support for class X should be
>> provided by X.hpp and it must be possible to do this without
>> depending on any other header.
>
> I don't agree, except in the rare cases where serialization is one of
> the core responsibilities of the class. The one thing that I realize is
> often unavoidable is providing the serialization mechanism access to a
> class's private state and I consider this rather unfortunate.

If your serialization methods

- allow creation of objects whose invariants do not hold, or
- expose implementation details in the external representation,

they are broken.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk