Boost logo

Boost Users :

From: Denis Kuznetsov (denis_at_[hidden])
Date: 2006-03-04 13:27:55


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<class Archive, class T>
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<const T &>(t));
}

Why my code doesn't compile and what should I do to build it?



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