
Damien * wrote:
has anyone seen this compile error before, and know how to fix it?
/usr/local/include/boost-1_32/boost/archive/detail/iserializer.hpp:428:
no type named `type' in `struct boost::mpl::eval_if<boost::is_abstract<MyClass>,
boost::mpl::identity<boost::archive::detail::load_pointer_type<boost::archive::text_iarchive,
MyClass*>::abstract<MyClass> >,
boost::mpl::identity<boost::archive::detail::load_pointer_type<boost::archive::text_iarchive,
MyClass*>::non_abstract<MyClass> > >'
im trying to serialize a polymorphic class that has a pointer to another class of the same type in it. if i comment out that line in the serialization function, the error goes away.
is MyClass abstract? That is, does it have a pure abstract function in it ( func() = 0;)? Check BOOST_IS_ABSTRACT in the documentation.
Robert Ramey
MyClass is not abstract. it has virtual functions, but no pure virtual functions. if i use that macro however, the error goes away, but i then get this runtime assertion failure when it tries to serialize out.
/usr/local/include/boost-1_32/boost/archive/detail/oserializer.hpp:432: static void boost::archive::detail::save_pointer_type<Archive, TPtr>::polymorphic<T>::save(Archive&, const T&, const boost::archive::detail::basic_pointer_oserializer*) [with T = MyClass, Archive = boost::archive::binary_oarchive, TPtr = MyClass*]: Assertion `__null != bpos_ptr' failed.
Hmm, are we serializing through a base class or a derived class? If through a base class has the derived class been "registered" via register(..) or via BOOST_CLASS_EXPORT?
Robert Ramey
that appears to have done the trick. thanks a bunch. i dont understand why i had to use the BOOST_IS_ABSTRACT macro for a class that wasnt abstract though. oh well. thanks again.