comparison DEPENDENCIES/generic/include/boost/serialization/level.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_SERIALIZATION_LEVEL_HPP 1 #ifndef BOOST_SERIALIZATION_LEVEL_HPP
2 #define BOOST_SERIALIZATION_LEVEL_HPP 2 #define BOOST_SERIALIZATION_LEVEL_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 #endif 7 #endif
8 8
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // level.hpp: 10 // level.hpp:
27 27
28 #include <boost/mpl/eval_if.hpp> 28 #include <boost/mpl/eval_if.hpp>
29 #include <boost/mpl/int.hpp> 29 #include <boost/mpl/int.hpp>
30 #include <boost/mpl/integral_c.hpp> 30 #include <boost/mpl/integral_c.hpp>
31 #include <boost/mpl/integral_c_tag.hpp> 31 #include <boost/mpl/integral_c_tag.hpp>
32 #include <boost/mpl/aux_/nttp_decl.hpp>
33 32
34 #include <boost/serialization/level_enum.hpp> 33 #include <boost/serialization/level_enum.hpp>
35 34
36 namespace boost { 35 namespace boost {
37 namespace serialization { 36 namespace serialization {
41 // default serialization implementation level 40 // default serialization implementation level
42 template<class T> 41 template<class T>
43 struct implementation_level_impl { 42 struct implementation_level_impl {
44 template<class U> 43 template<class U>
45 struct traits_class_level { 44 struct traits_class_level {
46 typedef BOOST_DEDUCED_TYPENAME U::level type; 45 typedef typename U::level type;
47 }; 46 };
48 47
49 typedef mpl::integral_c_tag tag; 48 typedef mpl::integral_c_tag tag;
50 // note: at least one compiler complained w/o the full qualification 49 // note: at least one compiler complained w/o the full qualification
51 // on basic traits below 50 // on basic traits below
52 typedef 51 typedef
53 BOOST_DEDUCED_TYPENAME mpl::eval_if< 52 typename mpl::eval_if<
54 is_base_and_derived<boost::serialization::basic_traits, T>, 53 is_base_and_derived<boost::serialization::basic_traits, T>,
55 traits_class_level< T >, 54 traits_class_level< T >,
56 //else 55 //else
57 BOOST_DEDUCED_TYPENAME mpl::eval_if< 56 typename mpl::eval_if<
58 is_fundamental< T >, 57 is_fundamental< T >,
59 mpl::int_<primitive_type>, 58 mpl::int_<primitive_type>,
60 //else 59 //else
61 BOOST_DEDUCED_TYPENAME mpl::eval_if< 60 typename mpl::eval_if<
62 is_class< T >, 61 is_class< T >,
63 mpl::int_<object_class_info>, 62 mpl::int_<object_class_info>,
64 //else 63 //else
65 BOOST_DEDUCED_TYPENAME mpl::eval_if< 64 typename mpl::eval_if<
66 is_array< T >, 65 is_array< T >,
67 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560)) 66 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560))
68 mpl::int_<not_serializable>, 67 mpl::int_<not_serializable>,
69 #else 68 #else
70 mpl::int_<object_serializable>, 69 mpl::int_<object_serializable>,
71 #endif 70 #endif
72 //else 71 //else
73 BOOST_DEDUCED_TYPENAME mpl::eval_if< 72 typename mpl::eval_if<
74 is_enum< T >, 73 is_enum< T >,
75 //#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560)) 74 //#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560))
76 // mpl::int_<not_serializable>, 75 // mpl::int_<not_serializable>,
77 //#else 76 //#else
78 mpl::int_<primitive_type>, 77 mpl::int_<primitive_type>,
92 struct implementation_level : 91 struct implementation_level :
93 public implementation_level_impl<const T> 92 public implementation_level_impl<const T>
94 { 93 {
95 }; 94 };
96 95
97 template<class T, BOOST_MPL_AUX_NTTP_DECL(int, L) > 96 template<class T, int L>
98 inline bool operator>=(implementation_level< T > t, enum level_type l) 97 inline bool operator>=(implementation_level< T > t, enum level_type l)
99 { 98 {
100 return t.value >= (int)l; 99 return t.value >= (int)l;
101 } 100 }
102 101