Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-11-27 23:37:41


Peter Dimov wrote:
> Robert Ramey wrote:
>> Peter Dimov wrote:
>>
>>> When the author of X that has two fields x and y wants to serialize
>>> it into _any_ archive, he just "says" save(x) and save(y) to the
>>> archive.
>>>
>>> However, the author of Y that contains an array currently can't just
>>> say save_array(a) to the archive, because save_array is not part of
>>> the current vocabulary. He needs to say save(a[0]), save(a[1]), ...,
>>> save(a[n-1]).
>>
>> he needs to say save(a) that is ar << a. In any of the proposals
>> the correct override will be invoked.
>
> This only works for C-style arrays with the size fixed at compile
> time.
> Think about how one would write "save" for the following:

OK that's how I interpreted the [] brackets.

Having thought about this a little more - and knowing I faced this
issue before I remembered the concept of "serialization wrapper"
as documented in the manual. ( I see now that the explanation
is slightly out of whack - but I'll address that later.) This is
used to implement name-value pairs. The implementation is
such that those archives that don't use them don't have to have
them included in the archive header. Those that do can take
advantage of them. Looking back - I now remember I invented
the "serialization wrapper to address exactly this situation"

To summarize

The basic idea is to define something


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