Robert Ramey wrote:
Emil Dotchevski wrote:
On Thu, Sep 25, 2008 at 9:59 AM, Robert Ramey
wrote: Could you point me to the documentation that describes the alternative to BOOST_CLASS_EXPORT mechanism to register base/derived types? I found the void_cast_register function but there should be more to it since the various templates for serializing user types need to be instantiated for the different archives, right? Look at the archive class. It contains a function call "register" which is used as ar.register(static_cast
(0)); This will "register" myType in archive instance ar. This is 100% failsafe and portable. Perhaps you might want to do something like template<class Archive> void register_all_my_types(Archive &ar){ ar.register(static_cast
(0)); ar.register(static_cast (0)); ... } { text_oarchive oa(..);
register_all_my_types(oa); ar << x; ar << y; ... }
Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Thanks, this Idea works for me pretty good. And I prefer it instead of a static intialisation of my class types. regards, Jens Weller