Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] map of shared_ptr
From: Sebastian Messerschmidt (sebastian.messerschmidt_at_[hidden])
Date: 2013-10-03 10:53:05


Hi Mathieu,

Thank you for the hint. I solved it by wrapping the shared_ptr into
class holding it and there serializing the data held by the pointer.

cheers
Sebastian
> On 03/10/2013 11:52, Sebastian Messerschmidt wrote:
>> Hi folks,
>>
>> (...)
>> What am I doing wrong?
>>
>
> Hi Sebastian,
>
> This is because you are serializing the same shared_ptr over and over
> again so it's only serialized the first time and all the other times
> the library notices it's the same pointer and will only serialize a
> "reference" to it.
> See
> http://www.boost.org/doc/libs/1_49_0/libs/serialization/doc/serialization.html#pointeroperators
> which explains this.
>
> I hope this helps,
> MAT.
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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