Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-06-09 14:17:38


Tim Taylor wrote:
> Hi,
>
> I am having some troubles with serialization of shared_ptrs. The
> basic problem is that when I serialize a shared_ptr, then later
> deserialize into a new shared_ptr, the use_count of the new pointer
> is, incorrectly (as far as I can see), 2 rather than 1.
>
> I am using boost 1.33.1 and gcc 4.0.1.

Try destroying the archive object and check the use count again. The archive
probably keeps its own temporary copy of the shared_ptr.


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