So now 'unit' only has a template serialize method, but I still
int main() { unit u(42);
{ std::cout << "template:" << std::endl; test_oarchive ar(std::cout); ar << BOOST_SERIALIZATION_NVP(u); std::cout << std::endl; }
{ std::cout << "polymorphic:" << std::endl; polymorphic_test_oarchive ar(std::cout); ar << BOOST_SERIALIZATION_NVP(u); std::cout << std::endl; } }
Which outputs:
template:
42 polymorphic: 42
Code is attached.
what happens when you try: std::cout << "polymorphic:" << std::endl; polymorphic_oarchive & po = polymorphic_test_oarchive ar(std::cout); po << BOOST_SERIALIZATION_NVP(u); std::cout << std::endl; This would actually be using the polymorphic interface as it's intended to be used by routing the serialization through the polymorphic interface. Robert Ramey