|
Boost Users : |
From: Hugh Hoover (hugh_at_[hidden])
Date: 2006-05-20 19:45:12
On May 20, 2006, at 14:49, Robert Ramey wrote:
> Hugh Hoover wrote:
>> Robert Ramey has mentioned in other messages that default
>> construction with de-serializing is tantamount to "proper"
>> construction anyway, and I agree with that - you need to consider the
>> de-serialization as a form of construction rather than something you
>> do the object after construction.
>
> Hmmm - I don't remember saying that. In any case I feel quite
In the discussion:
http://lists.boost.org/boost-users/2005/09/13827.php
You don't say exactly that - but that's what I inferred :)
> confident that the load_constract_data method is functional,
> convenient, and even necessary in some cases. I have in
> reason to believe that it doesn't work with abstract base
> classes either. The serialization library keeps track of the
> types of derived pointers.
as near as I can tell, it DOES work for non-abstract derived classes
in my tests (and the examples), but if you try to deserialize like:
Base * pb = NULL;
ar >> pb;
Then you end up in load_construct_data_adl<class Archive, class T>
(Archive& ar, T*t,version) - which calls
load_construct_data<Archive,T> - which gets the default version
because there is no definition of load_construct_data for the base
class (in my case, anyway). I've not managed to get it to work in
this case - and I didn't need it to, since I could write a serialize
function with a private default constructor.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net