What I recommend is the following:
// header my_class.h
#include
....
// no boost/archive headers here !!!
class my_class {
....
}
BOOST_CLASS_EXPORT(my_class)
// note: header only - implementation goes below
template<class Archive>
serialize(Archive &ar, my_class &t....);
// my_class_serialization.cpp or my_class.cpp or .. *.cpp
#include
.... // 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
template
void serialize;
... // explicit instantiation for all other archives you might use here.
Robert Ramey
"RIVASSEAU Jean Noel" wrote in message
news:87F60F7FA02FF749AFB02BD9FCAA6B04DE14BE@naserv31.nanterre.oberthurcs.com...
Hello :
Regarding my last post :
Even a manual template instantiation is in fact impossible since it would
require including the necessary archive headers (else, the boost ::archive
::xml_iarchive is not recognized). Since you forbid to include any archive
headers in the classes, I do not understand how you can follow your own
advice. This seems impossible to me. Would you have code to illustrate ?
Jean-Noël
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users