|
|
 |
boost
[boost] Re: [serialization] default-constructors (was
Re[serialization]problem deserializing vectors)
by David Abrahams other posts by this author
Oct 4 2003 12:24PM messages near this date
[boost] Re: Re: [serialization] default-constructors (was
Re[serialization]problem deserializing vectors)
|
[boost] Re: volatile and thread-safety
Robert Ramey <ramey@[...].com> 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
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Robert Ramey
Vladimir Prus
Samuel Krempp
David Abrahams
|
|
|
 |
|