inline void check_pointer_level(){ // we should only invoke this once we KNOW that T // has been used as a pointer!! typedef BOOST_DEDUCED_TYPENAME mpl::or_< BOOST_DEDUCED_TYPENAME mpl::greater< serialization::implementation_level<T>, mpl::int_<serialization::object_serializable> >, BOOST_DEDUCED_TYPENAME mpl::not_< BOOST_DEDUCED_TYPENAME mpl::equal_to< serialization::tracking_level<T>, mpl::int_<serialization::track_selectively> > > > typex; // Address the following when serializing to a pointer: // a) This type doesn't save class information in the // archive. That is, the serialization trait implementation // level <= object_serializable. // b) Tracking for this type is set to "track selectively" // in this case, indication that an object is tracked is // not stored in the archive itself - see level == object_serializable // but rather the existence of the operation ar >> T * is used to // infer that an object of this type should be tracked. So, if // you save via a pointer but don't load via a pointer the operation // will fail on load without given any valid reason for the failure. // So if your program traps here, consider changing the // tracking or implementation level traits - or not // serializing via a pointer. BOOST_STATIC_WARNING(typex::value); }
inline typename boost::disable_if_c< sizeof(boost::uintmax_t) >= sizeof(Div_type), void >::type float_sort(RandomAccessIter first, RandomAccessIter last, Div_type, Right_shift rshift, Compare comp) { BOOST_STATIC_WARNING(sizeof(boost::uintmax_t) >= sizeof(Div_type)); std::sort(first, last, comp); }
guid_initializer const & export_guid() const { BOOST_STATIC_WARNING(boost::is_polymorphic< T >::value); // note: exporting an abstract base class will have no effect // and cannot be used to instantitiate serialization code // (one might be using this in a DLL to instantiate code) //BOOST_STATIC_WARNING(! boost::serialization::is_abstract< T >::value); export_guid(boost::serialization::is_abstract< T >()); return *this; }
void inline check_pointer_tracking(){ typedef BOOST_DEDUCED_TYPENAME mpl::greater< serialization::tracking_level<T>, mpl::int_<serialization::track_never> >::type typex; // serializing an object of a type marked "track_never" through a pointer // could result in creating more objects than were saved! BOOST_STATIC_WARNING(typex::value); }
// get the eti record for the true type of this record // relying upon standard type info implemenation (rtti) const extended_type_info * get_derived_extended_type_info(const T & t) const { // note: this implementation - based on usage of typeid (rtti) // only does something if the class has at least one virtual function. BOOST_STATIC_WARNING(boost::is_polymorphic< T >::value); return typeid_system::extended_type_info_typeid_0::get_extended_type_info( typeid(t) ); }
inline typename boost::disable_if_c< (sizeof(boost::uint64_t) == sizeof(typename std::iterator_traits<RandomAccessIter>::value_type) || sizeof(boost::uint32_t) == sizeof(typename std::iterator_traits<RandomAccessIter>::value_type)) && std::numeric_limits<typename std::iterator_traits<RandomAccessIter>::value_type>::is_iec559, void >::type float_sort(RandomAccessIter first, RandomAccessIter last) { BOOST_STATIC_WARNING(!(sizeof(boost::uint64_t) == sizeof(typename std::iterator_traits<RandomAccessIter>::value_type) || sizeof(boost::uint32_t) == sizeof(typename std::iterator_traits<RandomAccessIter>::value_type)) || !std::numeric_limits<typename std::iterator_traits<RandomAccessIter>::value_type>::is_iec559); std::sort(first, last); }
inline void check_object_tracking(){ // presume it has already been determined that // T is not a const BOOST_STATIC_ASSERT(! boost::is_const<T>::value); typedef BOOST_DEDUCED_TYPENAME mpl::equal_to< serialization::tracking_level<T>, mpl::int_<serialization::track_never> >::type typex; // saving an non-const object of a type not marked "track_never) // may be an indicator of an error usage of the // serialization library and should be double checked. // See documentation on object tracking. Also, see the // "rationale" section of the documenation // for motivation for this checking. BOOST_STATIC_WARNING(typex::value); }
int f() { BOOST_STATIC_WARNING(T::value); return 0; }