Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-10-04 07:24:12


Robert Ramey <ramey_at_[hidden]> writes:

> This circumstance which provoked the current confusion is a result
> of my interpretation of what it means to serialize a collection - in
> this case a vector.
>
> In such a case the most natural (to me) interpretation was to clear the
> vector and re-create the vector elements - STL calls default constructor
> in this case which you chose to make private to inhibit other potential
> callers.
>
> My response was that I didn't believe that one should even have
> a default constructor in such cases. I showed how to override
> the collection load function to implement such a point of view.
>
> Upon reflection, I've come to believe my response was beside the point
> and confused the issue. I am going to tweak the library so that
> loading of collections is handled specially and given access to
> any private default constructor. I now believe that this will not
> create any of the problems I originally envisioned.

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?

-- 
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