This is the best answer I have been able to come up with myself. If someone has something better to say on this I will accept that as an answer instead.
The boost/serialization/shared_ptr.hpp
header that boost ships with is not support for std::shared_ptr
but for boost::shared_ptr
. If you want to make serialization work with shared pointer objects without bootlegging your own serialization code then you will need to convert your std::shared_ptr
objects to boost::shared_ptr
objects and live with the consequences.
My misunderstanding was that I thought that boost/serialization/shared_ptr.hpp
defined a serialize
method for std::shared_ptr
. I was wrong.