|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2003-10-05 06:57:52
Robert Ramey <ramey_at_[hidden]> writes:
> Dave Abrahams
>
>>Of course I may be missing something, but it seems to me that the
>>correct approach for deserializing a collection is to deserialize
>>each element and then copy it into the collection with push_back. Am
>>I missing something crucial?
>
> That what the current implemenation does. in order to have an object
> to push_back one has to be created on the stack
The heap works just as well as the stack for these purposes. Still
needs a constructor or some sort of factory function.
> and deserialized. Hence the question arose regarding a default
> private constructor (which should be "public" to deserialiaiton).
>
> There are other plausible interpretations of what serializaton would mean
> for a collection but the currently implemented one seems the
> most obvious to me. Its only "quirk" is that it required construction
> of new elements which up until now has been unnecessary for
> deserialization in other situations. That's why we were thrown a little off.
You can deserialize non-collections without constructing them
somehow?? That surprises me. Or do you mean something else?
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk