Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-07-13 23:21:43

Ivan Rachev wrote:
> Martin Ecker wrote:
>> Hi,
>> Ivan Rachev wrote:
>>> If class A from the example is replaced by char, how should this
>>> situation be handled? Code follows at the end.
>> This is not recommended. Fundamental types are not tracked by
>> default, so it won't work. You'd have to turn on tracking for char,
>> but that is not a good idea, since then _all_ values of type char
>> that are tracked, and this can cause quite a bit of overhead.
>> If you really need a pointer that directly points into an array (and
>> you can't redesign the code), you could wrap the array elements in a
>> different type that can be tracked in your serialization code. All
>> pointers into the array would also need to be wrapped when
>> serialized.
>> Regards,
>> Martin
> before writing my own wrappers I would like to see if the overhead of
> tracking chars is acceptable for me. I tried putting the following
> into my cpp but it won't compile:
> #include <boost/serialization/tracking.hpp>
> BOOST_CLASS_TRACKING(char, boost::serialization::track_selectivly)
> I guess I need to change the default "implementation_level" for char.
> What other things do I need to change so as to make a fundamental type
> trackable?
> Thanks,
> Ivan

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at