
If I do not register base classe <Modul>, nor in serializing code nor in deserializing code: It compliles and serializing runs and creates perfect archive. But when I try to deserialize the archive I get a runtime error: terminate called after throwing an instance of 'boost::archive::archive_exception' what(): stream error How do I de/serialize: I created a class and use a vector of base class pointers: class LogElement { public: LogElement(); virtual ~LogElement(){}; std::vector<Modul*> Module; private: friend class boost::serialization::access; template <typename Archive> void serialize(Archive &ar, const unsigned int version) { ar & boost::serialization::make_nvp("Module", Module); }; }; In Module are pointers to objects of derived classes. Is it a problem? Am 03.11.2011 06:09, schrieb Robert Ramey:
Fabian Weiss wrote:
How can I serialize my abstract base class?
you should only need to register the derived classes.
Robert Ramey
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users