#include #include #include class base { friend class boost::serialization::access; template void serialize(Archive & ar, const unsigned int version) { } public: base() {} virtual ~base() throw() {} }; class derived : public base { friend class boost::serialization::access; template void serialize(Archive & ar, const unsigned int version) { ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(base); } public: derived() { } virtual ~derived() throw() { } }; int main(void) { derived something; std::ostringstream out; boost::archive::binary_oarchive oa(out); oa << something; return 0; }