Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2003-12-08 11:26:51


Alexey Nikitin wrote:

>#include <boost/serialization/tracking.hpp>

>template<class T>
>struct A
>{
> template<class Archive>
> void serialize(Archive& ar, const unsigned long file_version)
> {
> ar & m_;
> }
> T m_;
>};

>BOOST_CLASS_TRACKING(A, boost::serialization::track_never)
> //^^^
> //It is not compiled.
> //What I must write here?

In reviewing tracking.hpp, it can be seen that the above macro doesn't expand
to anything sensible when argument is a template.

However, on compilers that support partial specialization, we should be able
to assign a tracking type trait with the following:

// specify the current tracking behavior for the class
namespace boost {
namespace serialization {

template<class T>
struct tracking_level<A<T> >{
    typedef mpl::int_< boost::serialization::track_never> type;
    BOOST_STATIC_CONSTANT(enum tracking_type, value = boost::serialization::track_never);
};

} // namespace serialization
} // namespace boost

Let me know how this works.

Robert Ramey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk