|
Boost : |
Subject: Re: [boost] Serialization of std::shared_ptr
From: Loïc Joly (loic.actarus.joly_at_[hidden])
Date: 2011-02-16 16:43:15
Le 16/02/2011 20:38, Emil Dotchevski a écrit :
> On Wed, Feb 16, 2011 at 5:20 AM, Loïc Joly
> <loic.actarus.joly_at_[hidden]> wrote:
>> I'm using the std::shared_ptr provided with MSVC 2010. I'd like to be able
>> to use boost.serialization to serialize some of those shared_ptrs. I could
>> find an old thread stating that std::tr1::shared_ptr were not handled (and
>> it looked impossible to make them work). Is the situation the same with
>> std::shared_ptr?
> If serializing std::shared_ptr/weak_ptr is impossible then I must have
> done the impossible in my serialization lib. :)3.
You did not know it was impossible, so you did it :)
I was just refeing to a message from Robert Ramey:
http://lists.boost.org/Archives/boost/2004/11/76074.php
It looks like the implementation of the serialization of
boost::shared_ptr has changed a lot since that time, and it might be
possible to adapt it to std::shared_ptr. From what I understand,
however, this serialization needs extra bookeeping which is currently
stored inside of the archive class. So it looks like I have to define my
own archive to be able to serialize std::shared_ptr. I'm gonna give a
thought about that.
Anyway, now that parts of boost have been standardized, I think it would
be great if those could interface smoothly with the parts of boost that
have not.
-- Loïc
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk