Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization, archive] Serialize boost::shared_ptr to custom archive
From: Stefan Strasser (strasser_at_[hidden])
Date: 2013-03-10 03:20:26


Am 10.03.2013 01:27, schrieb Silviu P:
> Hi,
>
> I'm trying to serialize a boost::shared_ptr to a custom archive. The
> compiler complains about the archive missing methods 'append' and
> 'reset'. Does anyone know where I should look to find out more
> information about these two methods?

Derive your archive class from detail::shared_ptr_helper, defined in
archive/shared_ptr_helper.hpp, and it should work.

As to why this is undocumented and in namespace detail I can only
speculate, but this is what the other archive classes do.

> /usr/include/boost/serialization/shared_ptr.hpp:133:9: error: ‘class
> my_iarchive’ has no member named ‘append’
> /usr/include/boost/serialization/shared_ptr.hpp:139:5: error: ‘class
> my_iarchive’ has no member named ‘reset’
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net