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$
12// $Revision$
13
14//
15// This header is deprecated and no longer used by type_traits:
16//
17#if defined(__GNUC__) || defined(_MSC_VER)
18# pragma message("NOTE: Use of this header (bool_trait_def.hpp) is deprecated")
19#endif
20
21#include <boost/type_traits/detail/template_arity_spec.hpp>
22#include <boost/type_traits/integral_constant.hpp>
23#include <boost/config.hpp>
24
25//
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....
29//
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
45#endif
46
47#ifndef BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL
48# define BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) /**/
49#endif
50
51#ifndef BOOST_TT_AUX_BOOL_C_BASE
52# define BOOST_TT_AUX_BOOL_C_BASE(C) : public ::boost::integral_constant<bool,C>
53#endif
54
55
56#define BOOST_TT_AUX_BOOL_TRAIT_DEF1(trait,T,C) \
57template< typename T > struct trait \
58 BOOST_TT_AUX_BOOL_C_BASE(C) \
59{ \
60public:\
61 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
62}; \
63\
64BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \
65/**/
66
67
68#define BOOST_TT_AUX_BOOL_TRAIT_DEF2(trait,T1,T2,C) \
69template< typename T1, typename T2 > struct trait \
70 BOOST_TT_AUX_BOOL_C_BASE(C) \
71{ \
72public:\
73 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
74}; \
75\
76BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,trait) \
77/**/
78
79#define BOOST_TT_AUX_BOOL_TRAIT_DEF3(trait,T1,T2,T3,C) \
80template< typename T1, typename T2, typename T3 > struct trait \
81 BOOST_TT_AUX_BOOL_C_BASE(C) \
82{ \
83public:\
84 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
85}; \
86\
87BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(3,trait) \
88/**/
89
90#define BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,C) \
91template<> struct trait< sp > \
92 BOOST_TT_AUX_BOOL_C_BASE(C) \
93{ \
94public:\
95 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
96}; \
97/**/
98
99#define BOOST_TT_AUX_BOOL_TRAIT_SPEC2(trait,sp1,sp2,C) \
100template<> struct trait< sp1,sp2 > \
101 BOOST_TT_AUX_BOOL_C_BASE(C) \
102{ \
103public:\
104 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
105}; \
106/**/
107
108#define BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(trait,sp,C) \
109template<> struct trait##_impl< sp > \
110{ \
111public:\
112 BOOST_STATIC_CONSTANT(bool, value = (C)); \
113}; \
114/**/
115
116#define BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,sp1,sp2,C) \
117template<> struct trait##_impl< sp1,sp2 > \
118{ \
119public:\
120 BOOST_STATIC_CONSTANT(bool, value = (C)); \
121}; \
122/**/
123
124#define BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(param,trait,sp,C) \
125template< param > struct trait< sp > \
126 BOOST_TT_AUX_BOOL_C_BASE(C) \
127{ \
128public:\
129 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
130}; \
131/**/
132
133#define BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(param1,param2,trait,sp,C) \
134template< param1, param2 > struct trait< sp > \
135 BOOST_TT_AUX_BOOL_C_BASE(C) \
136{ \
137public:\
138 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
139}; \
140/**/
141
142#define BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(param,trait,sp1,sp2,C) \
143template< param > struct trait< sp1,sp2 > \
144 BOOST_TT_AUX_BOOL_C_BASE(C) \
145{ \
146public:\
147 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
148}; \
149/**/
150
151#define BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(param1,param2,trait,sp1,sp2,C) \
152template< param1, param2 > struct trait< sp1,sp2 > \
153 BOOST_TT_AUX_BOOL_C_BASE(C) \
154{ \
155public:\
156 BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
157}; \
158/**/
159
160#define BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(param,trait,sp1,sp2,C) \
161template< param > struct trait##_impl< sp1,sp2 > \
162{ \
163public:\
164 BOOST_STATIC_CONSTANT(bool, value = (C)); \
165}; \
166/**/
167
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) \
174 /**/
175#else
176# define BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(trait,sp,value) \
177 BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,value) \
178 /**/
179#endif
180

source code of boost/boost/type_traits/detail/bool_trait_def.hpp