Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] disable BOOST_STATIC_WARNING fortrack_never objects?
From: Robert Ramey (ramey_at_[hidden])
Date: 2012-09-10 15:29:10


Brian Budge wrote:
> Hi all -
>
> It's possible that I'm still doing something questionable, in which
> case, I hope you'll let me know. If what I'm doing is okay, perhaps
> there's a way to disable this warning.
>
> I have a virtual class hierarchy which I use to pass messages via
> boost.mpi. These messages then perform dispatch through helper
> objects on either side of the communication. I want to turn off
> object pointer tracking, so I've set my classes via
> BOOST_CLASS_TRACKING(myclass, boost::serialization::track_never).

Turning off pointer tracking IS questionable if one is serializing through
ponters!
why not just leave it on?

> If this is expected, how can I turn the warning off? If it is not
> expected, are there suggestions for what might be changed?

consider the following alternatives

a) understand why the warning is there and ignore it on purpose.
Include comments in the source code of your app explaining your
decision

b) enable pointer tracking

c) consider different type of polymorphism - e.g. Boost.Variant
which is supported by Boost.Serialzation out of the box

d) experiment with serialziation via a base class reference. I
don't remember of Boost.Serialization has the smarts to
stay ahead of the programmer in this case.

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