2 // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
4 // Copyright Aleksey Gurtovoy 2002-2004
6 // Distributed under the Boost Software License, Version 1.0.
7 // (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
15 // This header is deprecated and no longer used by type_traits:
17 #if defined(__GNUC__) || defined(_MSC_VER)
18 # pragma message("NOTE: Use of this header (bool_trait_def.hpp) is deprecated")
21 #include <boost/type_traits/detail/template_arity_spec.hpp>
22 #include <boost/type_traits/integral_constant.hpp>
23 #include <boost/config.hpp>
26 // Unfortunately some libraries have started using this header without
27 // cleaning up afterwards: so we'd better undef the macros just in case
28 // they've been defined already....
30 #ifdef BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL
31 #undef BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL
32 #undef BOOST_TT_AUX_BOOL_C_BASE
33 #undef BOOST_TT_AUX_BOOL_TRAIT_DEF1
34 #undef BOOST_TT_AUX_BOOL_TRAIT_DEF2
35 #undef BOOST_TT_AUX_BOOL_TRAIT_SPEC1
36 #undef BOOST_TT_AUX_BOOL_TRAIT_SPEC2
37 #undef BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1
38 #undef BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2
39 #undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1
40 #undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2
41 #undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1
42 #undef BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2
43 #undef BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1
44 #undef BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1
47 #ifndef BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL
48 # define BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) /**/
51 #ifndef BOOST_TT_AUX_BOOL_C_BASE
52 # define BOOST_TT_AUX_BOOL_C_BASE(C) : public ::boost::integral_constant<bool,C>
56 #define BOOST_TT_AUX_BOOL_TRAIT_DEF1(trait,T,C) \
57 template< typename T > struct trait \
58 BOOST_TT_AUX_BOOL_C_BASE(C) \
61 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
64 BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \
68 #define BOOST_TT_AUX_BOOL_TRAIT_DEF2(trait,T1,T2,C) \
69 template< typename T1, typename T2 > struct trait \
70 BOOST_TT_AUX_BOOL_C_BASE(C) \
73 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
76 BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,trait) \
79 #define BOOST_TT_AUX_BOOL_TRAIT_DEF3(trait,T1,T2,T3,C) \
80 template< typename T1, typename T2, typename T3 > struct trait \
81 BOOST_TT_AUX_BOOL_C_BASE(C) \
84 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
87 BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(3,trait) \
90 #define BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,C) \
91 template<> struct trait< sp > \
92 BOOST_TT_AUX_BOOL_C_BASE(C) \
95 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
99 #define BOOST_TT_AUX_BOOL_TRAIT_SPEC2(trait,sp1,sp2,C) \
100 template<> struct trait< sp1,sp2 > \
101 BOOST_TT_AUX_BOOL_C_BASE(C) \
104 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
108 #define BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(trait,sp,C) \
109 template<> struct trait##_impl< sp > \
112 BOOST_STATIC_CONSTANT(bool, value = (C)); \
116 #define BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,sp1,sp2,C) \
117 template<> struct trait##_impl< sp1,sp2 > \
120 BOOST_STATIC_CONSTANT(bool, value = (C)); \
124 #define BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(param,trait,sp,C) \
125 template< param > struct trait< sp > \
126 BOOST_TT_AUX_BOOL_C_BASE(C) \
129 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
133 #define BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(param1,param2,trait,sp,C) \
134 template< param1, param2 > struct trait< sp > \
135 BOOST_TT_AUX_BOOL_C_BASE(C) \
138 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
142 #define BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(param,trait,sp1,sp2,C) \
143 template< param > struct trait< sp1,sp2 > \
144 BOOST_TT_AUX_BOOL_C_BASE(C) \
147 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
151 #define BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(param1,param2,trait,sp1,sp2,C) \
152 template< param1, param2 > struct trait< sp1,sp2 > \
153 BOOST_TT_AUX_BOOL_C_BASE(C) \
156 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
160 #define BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(param,trait,sp1,sp2,C) \
161 template< param > struct trait##_impl< sp1,sp2 > \
164 BOOST_STATIC_CONSTANT(bool, value = (C)); \
168 #ifndef BOOST_NO_CV_SPECIALIZATIONS
169 # define BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(trait,sp,value) \
170 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,value) \
171 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp const,value) \
172 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp volatile,value) \
173 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp const volatile,value) \
176 # define BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(trait,sp,value) \
177 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,value) \