Re: serialization: errata: even manual instantiationisimpossible

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: serialization: errata: even manual instantiationisimpossible


//  my_class_serialization.cpp or my_class.cpp or .. *.cpp

#include <boost/archive/xml_iarchive.hpp>
.... // all archives you might whant to use here.

template<class Archive>
serialize(Archive &ar, my_class &t....){
    ... serialization for class my_class

#include "my_class.hpp"

// explict instantiation here for all the archives which interest me

void serialize<boost::archive::xml_iarchive, my_class>;
... // explicit instantiation for all other archives you might use here.

I notice you still include the archive headers in my_class_serialization.cpp. In that case, you do not have in fact to manually instantiate templates, since my_class_serialization.cpp includes  "my_class.hpp" which includes export.hpp and maybe BOOST_CLASS_EXPORT after the archive headers included in class_serialization.cpp, so template instantiation will occure anyway.

Anyway let's close this topic. I understood what the point was.


Boost-users mailing list
[hidden email]