I am in need of a Boost::Serialization specialization for std::shared_ptr.
I am writing a program that sends objects over Boost::Asio and many of those objects use shared_ptrs internally. Using a workaround to only serialize the objects they are referring to is quite uncomfortable.
I have been trying to make my own, looking at the implementation provided for Boost::shared_ptr but I lack the understanding of how those objects should be handled.
Changing the namespaces in Boost::shared_ptr serialization made it possible to serialize the pointer but deserialization doesn’t work for me.
As a last resort, I could(and maybe should) switch over to using std::unique_ptrs for my objects, because, at the moment, it seems they own them, but that would lead me to the same problem, only with unique_ptr.
I am not sure if this is the best way to do this but it seems to work.
Changed the namespace and added this load method to shared_ptr specialization header copied from Boost::shared_ptr specialization: