diff --git a/include/boost/archive/detail/oserializer.hpp b/include/boost/archive/detail/oserializer.hpp index 932206d1..9dcb025c 100644 --- a/include/boost/archive/detail/oserializer.hpp +++ b/include/boost/archive/detail/oserializer.hpp @@ -276,35 +276,35 @@ struct save_non_pointer_type { }; typedef - BOOST_DEDUCED_TYPENAME mpl::eval_if< - // if its primitive - mpl::equal_to< - boost::serialization::implementation_level, - mpl::int_ - >, - mpl::identity, - // else - BOOST_DEDUCED_TYPENAME mpl::eval_if< - // class info / version - mpl::greater_equal< - boost::serialization::implementation_level, - mpl::int_ - >, - // do standard save - mpl::identity, - // else - BOOST_DEDUCED_TYPENAME mpl::eval_if< - // no tracking - mpl::equal_to< - boost::serialization::tracking_level, - mpl::int_ - >, - // do a fast save - mpl::identity, - // else - // do a fast save only tracking is turned off - mpl::identity - > > >::type typex; + BOOST_DEDUCED_TYPENAME mpl::eval_if< + // if its primitive + mpl::equal_to< + boost::serialization::implementation_level, + mpl::int_ + >, + mpl::identity, + // else + BOOST_DEDUCED_TYPENAME mpl::eval_if< + // class info / version + mpl::greater_equal< + boost::serialization::implementation_level, + mpl::int_ + >, + // do standard save + mpl::identity, + // else + BOOST_DEDUCED_TYPENAME mpl::eval_if< + // no tracking + mpl::equal_to< + boost::serialization::tracking_level, + mpl::int_ + >, + // do a fast save + mpl::identity, + // else + // do a fast save only tracking is turned off + mpl::identity + > > >::type typex; static void invoke(Archive & ar, const T & t){ // check that we're not trying to serialize something that @@ -557,6 +557,12 @@ struct check_tracking { 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::value); save(ar, const_cast(t)); }