Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] map of shared_ptr
From: Mathieu Champlon (m.champlon_at_[hidden])
Date: 2013-10-03 10:04:09


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 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