Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2007-03-31 18:41:36


Ruediger Berlich wrote:

> How can I teach the library that this particular shared_ptr just
> holds a basic type ?
>
>> Looking at you code, I can see you're trying to serialize a shared
>> pointer to an integer. addresses of prmitive types (int) are by
>> default not tracked as doing so would end up tracking ALL the ints
>> serialized which is not what most people would expect. if you want
>> to do this you'll have to wrap the int in a class so its type can be
>> distuished and it can then be tracked. Then I believe that
>> serializing a pointer to your wrapped class will function as you
>> hope and expect.

The issue tracking. We turn off tracking for prmitive types because
it would be "too much".

If yo want to override this for a particular case, make a small class/struct
which holds and int and serialize a shared pointer to that.

Robert Ramey


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