On Saturday, December 28, 2013 2:15:44 PM UTC-8, Martin Weinberg
wrote:
I have a
shared library for derived and base classes. My code passes
instances of derived classes T using
boost::shared_ptr<B> to the base
class. This all works as expected.
I've used the BOOST_CLASS_EXPORT_KEY and
BOOST_CLASS_EXPORT_IMPLEMENT
macros to register both the classes Tand shared_ptr<T>
typedefs to all
the classes.
If I attempt to serialize a base class pointer,
boost::serialization can
not find the serialize member for the shared_ptr to the
derived class.
a) double check the documentation boost/serialization/case
studies/shared_ptr<T> revisited
b) Make sure you'r doing the following
class A {...};
class B : public A {...}
...
A * = new B; // note we create a B and cast the address to
an A* !!!
... should be no problem from here on out.
Robert Ramey