#ifndef TEST_S11N_HPP #define TEST_S11N_HPP #include #include using namespace boost::serialization; class Base { public: virtual ~Base() {} template void serialize(Archive& ar, const unsigned int version) { } }; class Derived: public Base { public: int value_; Derived(int value) : value_(value) {} Derived() : value_(0) {} template void serialize(Archive& ar, const unsigned int version) { ar & make_nvp(BOOST_PP_STRINGIZE(Base), base_object(*this)); ar & make_nvp("value", value_); } }; #endif //TEST_S11N_HPP