comparison DEPENDENCIES/generic/include/boost/archive/detail/check.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
comparison
equal deleted inserted replaced
100:793467b5e61c 101:c530137014c0
1 #ifndef BOOST_ARCHIVE_DETAIL_CHECK_HPP 1 #ifndef BOOST_ARCHIVE_DETAIL_CHECK_HPP
2 #define BOOST_ARCHIVE_DETAIL_CHECK_HPP 2 #define BOOST_ARCHIVE_DETAIL_CHECK_HPP
3 3
4 // MS compatible compilers support #pragma once 4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020) 5 #if defined(_MSC_VER)
6 # pragma once 6 # pragma once
7 #pragma inline_depth(511) 7 #pragma inline_depth(511)
8 #pragma inline_recursion(on) 8 #pragma inline_recursion(on)
9 #endif 9 #endif
10 10
48 // checks for objects 48 // checks for objects
49 49
50 template<class T> 50 template<class T>
51 inline void check_object_level(){ 51 inline void check_object_level(){
52 typedef 52 typedef
53 BOOST_DEDUCED_TYPENAME mpl::greater_equal< 53 typename mpl::greater_equal<
54 serialization::implementation_level< T >, 54 serialization::implementation_level< T >,
55 mpl::int_<serialization::primitive_type> 55 mpl::int_<serialization::primitive_type>
56 >::type typex; 56 >::type typex;
57 57
58 // trap attempts to serialize objects marked 58 // trap attempts to serialize objects marked
61 } 61 }
62 62
63 template<class T> 63 template<class T>
64 inline void check_object_versioning(){ 64 inline void check_object_versioning(){
65 typedef 65 typedef
66 BOOST_DEDUCED_TYPENAME mpl::or_< 66 typename mpl::or_<
67 BOOST_DEDUCED_TYPENAME mpl::greater< 67 typename mpl::greater<
68 serialization::implementation_level< T >, 68 serialization::implementation_level< T >,
69 mpl::int_<serialization::object_serializable> 69 mpl::int_<serialization::object_serializable>
70 >, 70 >,
71 BOOST_DEDUCED_TYPENAME mpl::equal_to< 71 typename mpl::equal_to<
72 serialization::version< T >, 72 serialization::version< T >,
73 mpl::int_<0> 73 mpl::int_<0>
74 > 74 >
75 > typex; 75 > typex;
76 // trap attempts to serialize with objects that don't 76 // trap attempts to serialize with objects that don't
81 template<class T> 81 template<class T>
82 inline void check_object_tracking(){ 82 inline void check_object_tracking(){
83 // presume it has already been determined that 83 // presume it has already been determined that
84 // T is not a const 84 // T is not a const
85 BOOST_STATIC_ASSERT(! boost::is_const< T >::value); 85 BOOST_STATIC_ASSERT(! boost::is_const< T >::value);
86 typedef BOOST_DEDUCED_TYPENAME mpl::equal_to< 86 typedef typename mpl::equal_to<
87 serialization::tracking_level< T >, 87 serialization::tracking_level< T >,
88 mpl::int_<serialization::track_never> 88 mpl::int_<serialization::track_never>
89 >::type typex; 89 >::type typex;
90 // saving an non-const object of a type not marked "track_never) 90 // saving an non-const object of a type not marked "track_never)
91 91
103 template<class T> 103 template<class T>
104 inline void check_pointer_level(){ 104 inline void check_pointer_level(){
105 // we should only invoke this once we KNOW that T 105 // we should only invoke this once we KNOW that T
106 // has been used as a pointer!! 106 // has been used as a pointer!!
107 typedef 107 typedef
108 BOOST_DEDUCED_TYPENAME mpl::or_< 108 typename mpl::or_<
109 BOOST_DEDUCED_TYPENAME mpl::greater< 109 typename mpl::greater<
110 serialization::implementation_level< T >, 110 serialization::implementation_level< T >,
111 mpl::int_<serialization::object_serializable> 111 mpl::int_<serialization::object_serializable>
112 >, 112 >,
113 BOOST_DEDUCED_TYPENAME mpl::not_< 113 typename mpl::not_<
114 BOOST_DEDUCED_TYPENAME mpl::equal_to< 114 typename mpl::equal_to<
115 serialization::tracking_level< T >, 115 serialization::tracking_level< T >,
116 mpl::int_<serialization::track_selectively> 116 mpl::int_<serialization::track_selectively>
117 > 117 >
118 > 118 >
119 > typex; 119 > typex;
137 BOOST_STATIC_WARNING(typex::value); 137 BOOST_STATIC_WARNING(typex::value);
138 } 138 }
139 139
140 template<class T> 140 template<class T>
141 void inline check_pointer_tracking(){ 141 void inline check_pointer_tracking(){
142 typedef BOOST_DEDUCED_TYPENAME mpl::greater< 142 typedef typename mpl::greater<
143 serialization::tracking_level< T >, 143 serialization::tracking_level< T >,
144 mpl::int_<serialization::track_never> 144 mpl::int_<serialization::track_never>
145 >::type typex; 145 >::type typex;
146 // serializing an object of a type marked "track_never" through a pointer 146 // serializing an object of a type marked "track_never" through a pointer
147 // could result in creating more objects than were saved! 147 // could result in creating more objects than were saved!
149 } 149 }
150 150
151 template<class T> 151 template<class T>
152 inline void check_const_loading(){ 152 inline void check_const_loading(){
153 typedef 153 typedef
154 BOOST_DEDUCED_TYPENAME mpl::or_< 154 typename mpl::or_<
155 BOOST_DEDUCED_TYPENAME boost::serialization::is_wrapper< T >, 155 typename boost::serialization::is_wrapper< T >,
156 BOOST_DEDUCED_TYPENAME mpl::not_< 156 typename mpl::not_<
157 BOOST_DEDUCED_TYPENAME boost::is_const< T > 157 typename boost::is_const< T >
158 > 158 >
159 >::type typex; 159 >::type typex;
160 // cannot load data into a "const" object unless it's a 160 // cannot load data into a "const" object unless it's a
161 // wrapper around some other non-const object. 161 // wrapper around some other non-const object.
162 BOOST_STATIC_ASSERT(typex::value); 162 BOOST_STATIC_ASSERT(typex::value);