
Mikhail Kubzin wrote:
I have got one more question. If I were to use class A in some .cpp file, where I am not interested in serialization, do I still need to include serialization/archive/.. headers in that .cpp? Is it posssible to avoid that?
Absolutely NOT. That is the whole idea of maintainence of the concept of a serializable class distinct from that of an archive!!! So your example below should be altered to illustrate this. Note movement of #include <boost/archive/polymorphic_archive.hpp> to the implementation file A.cpp. Robert Ramey
----------------------------------------------------------------------- A.h
#include <boost/serialization/version.hpp> #include <boost/serialization/export.hpp> namespace boost { namespace serialization { class access; } } class A { }; BOOST_CLASS_VERSION(A, 1) BOOST_CLASS_EXPORT(A) ----------------------------------------------------------------------- A.cpp
#include <boost/archive/polymorphic_archive.hpp> #include "A.h" <<<<===== #include <boost/archive/polymorphic_archive.hpp>???? <<implementation> ----------------------------------------------------------------------- B.cpp
#include "A.h" void B::foo() { A a; a.DoSomething(); } ------------------------------------------------------------------------
Thank you very much in advance!
Mikhail
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost