[serialization] Problems with serializing a shared_ptr

Hello,
I want to add serialization support to the Eigen2 matrix class. It
works well (at least at compile time) until I try to serialize a
shared_ptr.
boost::shared_ptr<MatrixXd> shape;
template <typename Archive>
void serialize(Archive& ar, const unsigned int version) {
ar & BOOST_SERIALIZATION_NVP(shape);
};
I receive a long error message that begins with the first error:
/usr/local/include/boost/type_traits/has_new_operator.hpp: In
instantiation of
'boost::detail::has_new_operator_impl

Stefan Ulbrich wrote:
Has anybody a hint for me what is missing in the matrix class?
what compiler?
second, could anybody please explain to me what BOOST_SERIALIZATION_SHARED_PTR does and when I have to use it (only saw it in the demo file).
This is required to permit the implementation to work for compilers which fail to support partial template specialization. Robert Ramey
Thank you, Best regards Stefan
participants (2)
-
Robert Ramey
-
Stefan Ulbrich