
27 Aug
2010
27 Aug
'10
2:02 p.m.
Is it expected that the calls to register_type need to be identical on both the save and load side of a serialization exchange? I thought I read that the registration facility sets up a map. But the following caused a archive_exception. struct C {}; struct B : C {}; struct A : B {}; --- save boost::archive::text_oarchive oa(some_ostream); oa.register_type(static_cast<A*>(0)); oa.register_type(static_cast<B*>(0)); oa.register_type(static_cast<C*>(0)); oa & aC_ptr; --- load boost::archive::text_iarchive ia(some_istream); ia.register_type(static_cast<B*>(0)); ia.register_type(static_cast<A*>(0)); ia.register_type(static_cast<C*>(0)); oa & aC_ptr; Thanks, Jeff