From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-11-27 14:18:27
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
>> 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), save(a), ...,
> 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:
template<class T> struct my_array
T * data_;
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk