File indexing completed on 2025-01-18 09:28:27
0001 #ifndef BOOST_ARCHIVE_DETAIL_CHECK_HPP
0002 #define BOOST_ARCHIVE_DETAIL_CHECK_HPP
0003
0004
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #if !defined(__clang__)
0008 #pragma inline_depth(255)
0009 #pragma inline_recursion(on)
0010 #endif
0011 #endif
0012
0013 #if defined(__MWERKS__)
0014 #pragma inline_depth(255)
0015 #endif
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #include <boost/config.hpp>
0028
0029 #include <boost/static_assert.hpp>
0030 #include <boost/type_traits/is_const.hpp>
0031
0032 #include <boost/mpl/eval_if.hpp>
0033 #include <boost/mpl/or.hpp>
0034 #include <boost/mpl/equal_to.hpp>
0035 #include <boost/mpl/int.hpp>
0036 #include <boost/mpl/not.hpp>
0037 #include <boost/mpl/greater.hpp>
0038 #include <boost/mpl/assert.hpp>
0039
0040 #include <boost/serialization/static_warning.hpp>
0041 #include <boost/serialization/version.hpp>
0042 #include <boost/serialization/level.hpp>
0043 #include <boost/serialization/tracking.hpp>
0044 #include <boost/serialization/wrapper.hpp>
0045
0046 namespace boost {
0047 namespace archive {
0048 namespace detail {
0049
0050
0051
0052 template<class T>
0053 inline void check_object_level(){
0054 typedef
0055 typename mpl::greater_equal<
0056 serialization::implementation_level< T >,
0057 mpl::int_<serialization::primitive_type>
0058 >::type typex;
0059
0060
0061
0062 BOOST_STATIC_ASSERT(typex::value);
0063 }
0064
0065 template<class T>
0066 inline void check_object_versioning(){
0067 typedef
0068 typename mpl::or_<
0069 typename mpl::greater<
0070 serialization::implementation_level< T >,
0071 mpl::int_<serialization::object_serializable>
0072 >,
0073 typename mpl::equal_to<
0074 serialization::version< T >,
0075 mpl::int_<0>
0076 >
0077 > typex;
0078
0079
0080 BOOST_STATIC_ASSERT(typex::value);
0081 }
0082
0083 template<class T>
0084 inline void check_object_tracking(){
0085
0086
0087 BOOST_STATIC_ASSERT(! boost::is_const< T >::value);
0088 typedef typename mpl::equal_to<
0089 serialization::tracking_level< T >,
0090 mpl::int_<serialization::track_never>
0091 >::type typex;
0092
0093
0094
0095
0096
0097
0098
0099
0100 BOOST_STATIC_WARNING(typex::value);
0101 }
0102
0103
0104
0105 template<class T>
0106 inline void check_pointer_level(){
0107
0108
0109 typedef
0110 typename mpl::or_<
0111 typename mpl::greater<
0112 serialization::implementation_level< T >,
0113 mpl::int_<serialization::object_serializable>
0114 >,
0115 typename mpl::not_<
0116 typename mpl::equal_to<
0117 serialization::tracking_level< T >,
0118 mpl::int_<serialization::track_selectively>
0119 >
0120 >
0121 > typex;
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139 BOOST_STATIC_WARNING(typex::value);
0140 }
0141
0142 template<class T>
0143 void inline check_pointer_tracking(){
0144 typedef typename mpl::greater<
0145 serialization::tracking_level< T >,
0146 mpl::int_<serialization::track_never>
0147 >::type typex;
0148
0149
0150 BOOST_STATIC_WARNING(typex::value);
0151 }
0152
0153 template<class T>
0154 inline void check_const_loading(){
0155 typedef
0156 typename mpl::or_<
0157 typename boost::serialization::is_wrapper< T >,
0158 typename mpl::not_<
0159 typename boost::is_const< T >
0160 >
0161 >::type typex;
0162
0163
0164 BOOST_STATIC_ASSERT(typex::value);
0165 }
0166
0167 }
0168 }
0169 }
0170
0171 #endif