If I build the boost demo_auto_ptr example from
http://www.boost.org/libs/serialization/example/demo_auto_ptr.cpp
it works fine. But if I change my code (see attach) it doesnt't compile.
The main difference in my code from boost's sample is that I don't use
save() and load() functions. If I add and call them it works fine.
The reason my code doesn't compile is that I get BOOST_STATIC_ASSERT.
Compiler (VC 7.1 and VC 8.0) points to the code:
template
inline void save(Archive & ar, T &t){
// if your program traps here, it indicates taht your doing one of the
following:
// a) serializing an object of a type marked "track_never" through a
pointer.
// b) saving an non-const object of a type not markd "track_never)
// Either of these conditions may be an indicator of an error usage of
the
// serialization library and should be double checked. See
documentation on
// object tracking.
BOOST_STATIC_ASSERT(check_tracking<T>::value); // <---------- compile
error
save(ar, const_cast(t));
}
Why my code doesn't compile and what should I do to build it?