fixing stuff
[dyninst.git] / dynutil / h / dyn_detail / boost / type_traits / detail / bool_trait_def.hpp
1
2 // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
3
4 // Copyright Aleksey Gurtovoy 2002-2004
5 //
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)
9
10 // $Source$
11 // $Date: 2006-07-12 07:10:22 -0400 (Wed, 12 Jul 2006) $
12 // $Revision: 34511 $
13
14 #include <dyn_detail/boost/type_traits/detail/template_arity_spec.hpp>
15 #include <dyn_detail/boost/type_traits/integral_constant.hpp>
16 #include <dyn_detail/boost/mpl/bool.hpp>
17 #include <dyn_detail/boost/mpl/aux_/lambda_support.hpp>
18 #include <dyn_detail/boost/config.hpp>
19
20 //
21 // Unfortunately some libraries have started using this header without
22 // cleaning up afterwards: so we'd better undef the macros just in case 
23 // they've been defined already....
24 //
25 #ifdef DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL
26 #undef DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL
27 #undef DYN_DETAIL_BOOST_TT_AUX_BOOL_C_BASE
28 #undef DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_DEF1
29 #undef DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_DEF2
30 #undef DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_SPEC1
31 #undef DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_SPEC2
32 #undef DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1
33 #undef DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2
34 #undef DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1
35 #undef DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2
36 #undef DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1
37 #undef DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2
38 #undef DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1
39 #undef DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1
40 #endif
41
42 #if defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x570)
43 #   define DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
44         typedef ::dyn_detail::boost::integral_constant<bool,C> type; \
45     enum { value = type::value }; \
46     /**/
47 #   define DYN_DETAIL_BOOST_TT_AUX_BOOL_C_BASE(C)
48
49 #elif defined(DYN_DETAIL_BOOST_MSVC) && DYN_DETAIL_BOOST_MSVC < 1300
50
51 #   define DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
52     typedef ::dyn_detail::boost::integral_constant<bool,C> base_; \
53     using base_::value; \
54     /**/
55
56 #endif
57
58 #ifndef DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL
59 #   define DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) /**/
60 #endif
61
62 #ifndef DYN_DETAIL_BOOST_TT_AUX_BOOL_C_BASE
63 #   define DYN_DETAIL_BOOST_TT_AUX_BOOL_C_BASE(C) : ::dyn_detail::boost::integral_constant<bool,C>
64 #endif 
65
66
67 #define DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_DEF1(trait,T,C) \
68 template< typename T > struct trait \
69     DYN_DETAIL_BOOST_TT_AUX_BOOL_C_BASE(C) \
70 { \
71     DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
72     DYN_DETAIL_BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \
73 }; \
74 \
75 DYN_DETAIL_BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \
76 /**/
77
78
79 #define DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_DEF2(trait,T1,T2,C) \
80 template< typename T1, typename T2 > struct trait \
81     DYN_DETAIL_BOOST_TT_AUX_BOOL_C_BASE(C) \
82 { \
83     DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
84     DYN_DETAIL_BOOST_MPL_AUX_LAMBDA_SUPPORT(2,trait,(T1,T2)) \
85 }; \
86 \
87 DYN_DETAIL_BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,trait) \
88 /**/
89
90 #define DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,C) \
91 template<> struct trait< sp > \
92     DYN_DETAIL_BOOST_TT_AUX_BOOL_C_BASE(C) \
93 { \
94     DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
95     DYN_DETAIL_BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(sp)) \
96 }; \
97 /**/
98
99 #define DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_SPEC2(trait,sp1,sp2,C) \
100 template<> struct trait< sp1,sp2 > \
101     DYN_DETAIL_BOOST_TT_AUX_BOOL_C_BASE(C) \
102 { \
103     DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
104     DYN_DETAIL_BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2,trait,(sp1,sp2)) \
105 }; \
106 /**/
107
108 #define DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(trait,sp,C) \
109 template<> struct trait##_impl< sp > \
110 { \
111     DYN_DETAIL_BOOST_STATIC_CONSTANT(bool, value = (C)); \
112 }; \
113 /**/
114
115 #define DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,sp1,sp2,C) \
116 template<> struct trait##_impl< sp1,sp2 > \
117 { \
118     DYN_DETAIL_BOOST_STATIC_CONSTANT(bool, value = (C)); \
119 }; \
120 /**/
121
122 #define DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(param,trait,sp,C) \
123 template< param > struct trait< sp > \
124     DYN_DETAIL_BOOST_TT_AUX_BOOL_C_BASE(C) \
125 { \
126     DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
127 }; \
128 /**/
129
130 #define DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(param1,param2,trait,sp,C) \
131 template< param1, param2 > struct trait< sp > \
132     DYN_DETAIL_BOOST_TT_AUX_BOOL_C_BASE(C) \
133 { \
134     DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
135 }; \
136 /**/
137
138 #define DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(param,trait,sp1,sp2,C) \
139 template< param > struct trait< sp1,sp2 > \
140     DYN_DETAIL_BOOST_TT_AUX_BOOL_C_BASE(C) \
141 { \
142     DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
143     DYN_DETAIL_BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2,trait,(sp1,sp2)) \
144 }; \
145 /**/
146
147 #define DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(param1,param2,trait,sp1,sp2,C) \
148 template< param1, param2 > struct trait< sp1,sp2 > \
149     DYN_DETAIL_BOOST_TT_AUX_BOOL_C_BASE(C) \
150 { \
151     DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
152 }; \
153 /**/
154
155 #define DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(param,trait,sp1,sp2,C) \
156 template< param > struct trait##_impl< sp1,sp2 > \
157 { \
158     DYN_DETAIL_BOOST_STATIC_CONSTANT(bool, value = (C)); \
159 }; \
160 /**/
161
162 #ifndef DYN_DETAIL_BOOST_NO_CV_SPECIALIZATIONS
163 #   define DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(trait,sp,value) \
164     DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,value) \
165     DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp const,value) \
166     DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp volatile,value) \
167     DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp const volatile,value) \
168     /**/
169 #else
170 #   define DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(trait,sp,value) \
171     DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,value) \
172     /**/
173 #endif