serialize derived class object through boost::serialization
I want to serialize a derived class object through boost::serialization
library. To test whether both the base and the derived class object have been
serialized properly, I print message to the console when the serialize
function is called. When the following code is compiled and runned, the
message of serialize function for the base class object is not shown. Thus,
the base class object is not serialized properly. Why the serialization is not
done on the base class object?
#include <cstdlib>
#include <iostream>
#include <fstream>
#include
template<class Archive>void Derived::serialize(Archive & ar,const unsigned
int version){ ar & boost::serialization::base_object<Base>(*this); // add ar
& boost::serialization::void_cast_register _______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
breadbread1984
-
Robert Ramey