Chris@16
|
1
|
Chris@16
|
2 #if !defined(BOOST_PP_IS_ITERATING)
|
Chris@16
|
3
|
Chris@16
|
4 ///// header body
|
Chris@16
|
5
|
Chris@16
|
6 // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION!
|
Chris@16
|
7
|
Chris@16
|
8 // Copyright Aleksey Gurtovoy 2000-2004
|
Chris@16
|
9 //
|
Chris@16
|
10 // Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
11 // (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
12 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
13 //
|
Chris@16
|
14 // See http://www.boost.org/libs/mpl for documentation.
|
Chris@16
|
15
|
Chris@101
|
16 // $Id$
|
Chris@101
|
17 // $Date$
|
Chris@101
|
18 // $Revision$
|
Chris@16
|
19
|
Chris@16
|
20 #if !defined(BOOST_MPL_PREPROCESSING_MODE)
|
Chris@16
|
21 # include <boost/mpl/numeric_cast.hpp>
|
Chris@16
|
22 # include <boost/mpl/apply_wrap.hpp>
|
Chris@16
|
23 # include <boost/mpl/if.hpp>
|
Chris@16
|
24 # include <boost/mpl/tag.hpp>
|
Chris@16
|
25 # include <boost/mpl/aux_/numeric_cast_utils.hpp>
|
Chris@16
|
26 # include <boost/mpl/aux_/na.hpp>
|
Chris@16
|
27 # include <boost/mpl/aux_/na_spec.hpp>
|
Chris@16
|
28 # include <boost/mpl/aux_/lambda_support.hpp>
|
Chris@16
|
29 # include <boost/mpl/aux_/msvc_eti_base.hpp>
|
Chris@16
|
30 # include <boost/mpl/aux_/value_wknd.hpp>
|
Chris@16
|
31 # include <boost/mpl/aux_/config/eti.hpp>
|
Chris@16
|
32 # include <boost/mpl/aux_/nttp_decl.hpp>
|
Chris@16
|
33 #endif
|
Chris@16
|
34
|
Chris@16
|
35 #include <boost/mpl/aux_/config/static_constant.hpp>
|
Chris@16
|
36
|
Chris@16
|
37 #if defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
|
Chris@16
|
38 || defined(BOOST_MPL_PREPROCESSING_MODE)
|
Chris@16
|
39
|
Chris@16
|
40 # include <boost/mpl/limits/arity.hpp>
|
Chris@16
|
41 # include <boost/mpl/aux_/preprocessor/partial_spec_params.hpp>
|
Chris@16
|
42 # include <boost/mpl/aux_/preprocessor/def_params_tail.hpp>
|
Chris@16
|
43 # include <boost/mpl/aux_/preprocessor/repeat.hpp>
|
Chris@16
|
44 # include <boost/mpl/aux_/preprocessor/ext_params.hpp>
|
Chris@16
|
45 # include <boost/mpl/aux_/preprocessor/params.hpp>
|
Chris@16
|
46 # include <boost/mpl/aux_/preprocessor/enum.hpp>
|
Chris@16
|
47 # include <boost/mpl/aux_/preprocessor/add.hpp>
|
Chris@16
|
48 # include <boost/mpl/aux_/preprocessor/sub.hpp>
|
Chris@16
|
49 # include <boost/mpl/aux_/config/ctps.hpp>
|
Chris@16
|
50 # include <boost/mpl/aux_/config/eti.hpp>
|
Chris@16
|
51 # include <boost/mpl/aux_/config/msvc.hpp>
|
Chris@16
|
52 # include <boost/mpl/aux_/config/workaround.hpp>
|
Chris@16
|
53
|
Chris@16
|
54 # include <boost/preprocessor/dec.hpp>
|
Chris@16
|
55 # include <boost/preprocessor/inc.hpp>
|
Chris@16
|
56 # include <boost/preprocessor/iterate.hpp>
|
Chris@16
|
57 # include <boost/preprocessor/cat.hpp>
|
Chris@16
|
58
|
Chris@16
|
59
|
Chris@16
|
60 #if !defined(AUX778076_OP_ARITY)
|
Chris@16
|
61 # define AUX778076_OP_ARITY BOOST_MPL_LIMIT_METAFUNCTION_ARITY
|
Chris@16
|
62 #endif
|
Chris@16
|
63
|
Chris@16
|
64 #if !defined(AUX778076_OP_IMPL_NAME)
|
Chris@16
|
65 # define AUX778076_OP_IMPL_NAME BOOST_PP_CAT(AUX778076_OP_PREFIX,_impl)
|
Chris@16
|
66 #endif
|
Chris@16
|
67
|
Chris@16
|
68 #if !defined(AUX778076_OP_TAG_NAME)
|
Chris@16
|
69 # define AUX778076_OP_TAG_NAME BOOST_PP_CAT(AUX778076_OP_PREFIX,_tag)
|
Chris@16
|
70 #endif
|
Chris@16
|
71
|
Chris@16
|
72 namespace boost { namespace mpl {
|
Chris@16
|
73
|
Chris@16
|
74 template<
|
Chris@16
|
75 typename Tag1
|
Chris@16
|
76 , typename Tag2
|
Chris@16
|
77 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
Chris@16
|
78 , BOOST_MPL_AUX_NTTP_DECL(int, tag1_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag1)::value
|
Chris@16
|
79 , BOOST_MPL_AUX_NTTP_DECL(int, tag2_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag2)::value
|
Chris@16
|
80 >
|
Chris@16
|
81 struct AUX778076_OP_IMPL_NAME
|
Chris@16
|
82 : if_c<
|
Chris@16
|
83 ( tag1_ > tag2_ )
|
Chris@16
|
84 #else
|
Chris@16
|
85 >
|
Chris@16
|
86 struct AUX778076_OP_IMPL_NAME
|
Chris@16
|
87 : if_c<
|
Chris@16
|
88 ( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1)
|
Chris@16
|
89 > BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2)
|
Chris@16
|
90 )
|
Chris@16
|
91 #endif
|
Chris@16
|
92 , aux::cast2nd_impl< AUX778076_OP_IMPL_NAME<Tag1,Tag1>,Tag1,Tag2 >
|
Chris@16
|
93 , aux::cast1st_impl< AUX778076_OP_IMPL_NAME<Tag2,Tag2>,Tag1,Tag2 >
|
Chris@16
|
94 >::type
|
Chris@16
|
95 {
|
Chris@16
|
96 };
|
Chris@16
|
97
|
Chris@16
|
98 /// for Digital Mars C++/compilers with no CTPS/TTP support
|
Chris@16
|
99 template<> struct AUX778076_OP_IMPL_NAME<na,na>
|
Chris@16
|
100 {
|
Chris@16
|
101 template< typename U1, typename U2 > struct apply
|
Chris@16
|
102 {
|
Chris@16
|
103 typedef apply type;
|
Chris@16
|
104 BOOST_STATIC_CONSTANT(int, value = 0);
|
Chris@16
|
105 };
|
Chris@16
|
106 };
|
Chris@16
|
107
|
Chris@16
|
108 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
Chris@16
|
109 template< typename Tag > struct AUX778076_OP_IMPL_NAME<na,Tag>
|
Chris@16
|
110 {
|
Chris@16
|
111 template< typename U1, typename U2 > struct apply
|
Chris@16
|
112 {
|
Chris@16
|
113 typedef apply type;
|
Chris@16
|
114 BOOST_STATIC_CONSTANT(int, value = 0);
|
Chris@16
|
115 };
|
Chris@16
|
116 };
|
Chris@16
|
117
|
Chris@16
|
118 template< typename Tag > struct AUX778076_OP_IMPL_NAME<Tag,na>
|
Chris@16
|
119 {
|
Chris@16
|
120 template< typename U1, typename U2 > struct apply
|
Chris@16
|
121 {
|
Chris@16
|
122 typedef apply type;
|
Chris@16
|
123 BOOST_STATIC_CONSTANT(int, value = 0);
|
Chris@16
|
124 };
|
Chris@16
|
125 };
|
Chris@16
|
126 #else
|
Chris@16
|
127 template<> struct AUX778076_OP_IMPL_NAME<na,integral_c_tag>
|
Chris@16
|
128 {
|
Chris@16
|
129 template< typename U1, typename U2 > struct apply
|
Chris@16
|
130 {
|
Chris@16
|
131 typedef apply type;
|
Chris@16
|
132 BOOST_STATIC_CONSTANT(int, value = 0);
|
Chris@16
|
133 };
|
Chris@16
|
134 };
|
Chris@16
|
135
|
Chris@16
|
136 template<> struct AUX778076_OP_IMPL_NAME<integral_c_tag,na>
|
Chris@16
|
137 {
|
Chris@16
|
138 template< typename U1, typename U2 > struct apply
|
Chris@16
|
139 {
|
Chris@16
|
140 typedef apply type;
|
Chris@16
|
141 BOOST_STATIC_CONSTANT(int, value = 0);
|
Chris@16
|
142 };
|
Chris@16
|
143 };
|
Chris@16
|
144 #endif
|
Chris@16
|
145
|
Chris@16
|
146
|
Chris@16
|
147 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
Chris@16
|
148 && BOOST_WORKAROUND(BOOST_MSVC, >= 1300)
|
Chris@16
|
149 template< typename T > struct AUX778076_OP_TAG_NAME
|
Chris@16
|
150 : tag<T,na>
|
Chris@16
|
151 {
|
Chris@16
|
152 };
|
Chris@16
|
153 #else
|
Chris@16
|
154 template< typename T > struct AUX778076_OP_TAG_NAME
|
Chris@16
|
155 {
|
Chris@16
|
156 typedef typename T::tag type;
|
Chris@16
|
157 };
|
Chris@16
|
158 #endif
|
Chris@16
|
159
|
Chris@16
|
160
|
Chris@16
|
161 #if AUX778076_OP_ARITY != 2
|
Chris@16
|
162
|
Chris@16
|
163 # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
Chris@16
|
164
|
Chris@16
|
165 # define AUX778076_OP_RIGHT_OPERAND(unused, i, N) , BOOST_PP_CAT(N, BOOST_MPL_PP_ADD(i, 2))>
|
Chris@16
|
166 # define AUX778076_OP_N_CALLS(i, N) \
|
Chris@16
|
167 BOOST_MPL_PP_REPEAT( BOOST_PP_DEC(i), BOOST_MPL_PP_REPEAT_IDENTITY_FUNC, AUX778076_OP_NAME< ) \
|
Chris@16
|
168 N1 BOOST_MPL_PP_REPEAT( BOOST_MPL_PP_SUB(i, 1), AUX778076_OP_RIGHT_OPERAND, N ) \
|
Chris@16
|
169 /**/
|
Chris@16
|
170
|
Chris@16
|
171 template<
|
Chris@16
|
172 typename BOOST_MPL_AUX_NA_PARAM(N1)
|
Chris@16
|
173 , typename BOOST_MPL_AUX_NA_PARAM(N2)
|
Chris@16
|
174 BOOST_MPL_PP_DEF_PARAMS_TAIL(2, typename N, na)
|
Chris@16
|
175 >
|
Chris@16
|
176 struct AUX778076_OP_NAME
|
Chris@16
|
177 : AUX778076_OP_N_CALLS(AUX778076_OP_ARITY, N)
|
Chris@16
|
178 {
|
Chris@16
|
179 BOOST_MPL_AUX_LAMBDA_SUPPORT(
|
Chris@16
|
180 AUX778076_OP_ARITY
|
Chris@16
|
181 , AUX778076_OP_NAME
|
Chris@16
|
182 , ( BOOST_MPL_PP_PARAMS(AUX778076_OP_ARITY, N) )
|
Chris@16
|
183 )
|
Chris@16
|
184 };
|
Chris@16
|
185
|
Chris@16
|
186 #define BOOST_PP_ITERATION_PARAMS_1 \
|
Chris@16
|
187 (3,( BOOST_PP_DEC(AUX778076_OP_ARITY), 2, <boost/mpl/aux_/numeric_op.hpp> ))
|
Chris@16
|
188 #include BOOST_PP_ITERATE()
|
Chris@16
|
189
|
Chris@16
|
190 # undef AUX778076_OP_N_CALLS
|
Chris@16
|
191 # undef AUX778076_OP_RIGHT_OPERAND
|
Chris@16
|
192
|
Chris@16
|
193 # else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
Chris@16
|
194
|
Chris@16
|
195 /// forward declaration
|
Chris@16
|
196 template<
|
Chris@16
|
197 typename BOOST_MPL_AUX_NA_PARAM(N1)
|
Chris@16
|
198 , typename BOOST_MPL_AUX_NA_PARAM(N2)
|
Chris@16
|
199 >
|
Chris@16
|
200 struct BOOST_PP_CAT(AUX778076_OP_NAME,2);
|
Chris@16
|
201
|
Chris@16
|
202 template<
|
Chris@16
|
203 typename BOOST_MPL_AUX_NA_PARAM(N1)
|
Chris@16
|
204 , typename BOOST_MPL_AUX_NA_PARAM(N2)
|
Chris@16
|
205 BOOST_MPL_PP_DEF_PARAMS_TAIL(2, typename N, na)
|
Chris@16
|
206 >
|
Chris@16
|
207 struct AUX778076_OP_NAME
|
Chris@16
|
208 #if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
|
Chris@16
|
209 : aux::msvc_eti_base< typename if_<
|
Chris@16
|
210 #else
|
Chris@16
|
211 : if_<
|
Chris@16
|
212 #endif
|
Chris@16
|
213 is_na<N3>
|
Chris@16
|
214 , BOOST_PP_CAT(AUX778076_OP_NAME,2)<N1,N2>
|
Chris@16
|
215 , AUX778076_OP_NAME<
|
Chris@16
|
216 BOOST_PP_CAT(AUX778076_OP_NAME,2)<N1,N2>
|
Chris@16
|
217 , BOOST_MPL_PP_EXT_PARAMS(3, BOOST_PP_INC(AUX778076_OP_ARITY), N)
|
Chris@16
|
218 >
|
Chris@16
|
219 >::type
|
Chris@16
|
220 #if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
|
Chris@16
|
221 >
|
Chris@16
|
222 #endif
|
Chris@16
|
223 {
|
Chris@16
|
224 BOOST_MPL_AUX_LAMBDA_SUPPORT(
|
Chris@16
|
225 AUX778076_OP_ARITY
|
Chris@16
|
226 , AUX778076_OP_NAME
|
Chris@16
|
227 , ( BOOST_MPL_PP_PARAMS(AUX778076_OP_ARITY, N) )
|
Chris@16
|
228 )
|
Chris@16
|
229 };
|
Chris@16
|
230
|
Chris@16
|
231 template<
|
Chris@16
|
232 typename N1
|
Chris@16
|
233 , typename N2
|
Chris@16
|
234 >
|
Chris@16
|
235 struct BOOST_PP_CAT(AUX778076_OP_NAME,2)
|
Chris@16
|
236
|
Chris@16
|
237 #endif
|
Chris@16
|
238
|
Chris@16
|
239 #else // AUX778076_OP_ARITY == 2
|
Chris@16
|
240
|
Chris@16
|
241 template<
|
Chris@16
|
242 typename BOOST_MPL_AUX_NA_PARAM(N1)
|
Chris@16
|
243 , typename BOOST_MPL_AUX_NA_PARAM(N2)
|
Chris@16
|
244 >
|
Chris@16
|
245 struct AUX778076_OP_NAME
|
Chris@16
|
246
|
Chris@16
|
247 #endif
|
Chris@16
|
248
|
Chris@16
|
249 #if !defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
|
Chris@16
|
250 : AUX778076_OP_IMPL_NAME<
|
Chris@16
|
251 typename AUX778076_OP_TAG_NAME<N1>::type
|
Chris@16
|
252 , typename AUX778076_OP_TAG_NAME<N2>::type
|
Chris@16
|
253 >::template apply<N1,N2>::type
|
Chris@16
|
254 #else
|
Chris@16
|
255 : aux::msvc_eti_base< typename apply_wrap2<
|
Chris@16
|
256 AUX778076_OP_IMPL_NAME<
|
Chris@16
|
257 typename AUX778076_OP_TAG_NAME<N1>::type
|
Chris@16
|
258 , typename AUX778076_OP_TAG_NAME<N2>::type
|
Chris@16
|
259 >
|
Chris@16
|
260 , N1
|
Chris@16
|
261 , N2
|
Chris@16
|
262 >::type >::type
|
Chris@16
|
263 #endif
|
Chris@16
|
264 {
|
Chris@16
|
265 #if AUX778076_OP_ARITY != 2
|
Chris@16
|
266
|
Chris@16
|
267 # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
Chris@16
|
268 BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
|
Chris@16
|
269 AUX778076_OP_ARITY
|
Chris@16
|
270 , AUX778076_OP_NAME
|
Chris@16
|
271 , ( BOOST_MPL_PP_PARTIAL_SPEC_PARAMS(2, N, na) )
|
Chris@16
|
272 )
|
Chris@16
|
273 # else
|
Chris@16
|
274 BOOST_MPL_AUX_LAMBDA_SUPPORT(2, BOOST_PP_CAT(AUX778076_OP_NAME,2), (N1, N2))
|
Chris@16
|
275 # endif
|
Chris@16
|
276
|
Chris@16
|
277 #else
|
Chris@16
|
278 BOOST_MPL_AUX_LAMBDA_SUPPORT(2, AUX778076_OP_NAME, (N1, N2))
|
Chris@16
|
279 #endif
|
Chris@16
|
280 };
|
Chris@16
|
281
|
Chris@16
|
282 BOOST_MPL_AUX_NA_SPEC2(2, AUX778076_OP_ARITY, AUX778076_OP_NAME)
|
Chris@16
|
283
|
Chris@16
|
284 }}
|
Chris@16
|
285
|
Chris@16
|
286 #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
|
Chris@16
|
287
|
Chris@16
|
288 ///// iteration, depth == 1
|
Chris@16
|
289
|
Chris@16
|
290 // For gcc 4.4 compatability, we must include the
|
Chris@16
|
291 // BOOST_PP_ITERATION_DEPTH test inside an #else clause.
|
Chris@16
|
292 #else // BOOST_PP_IS_ITERATING
|
Chris@16
|
293 #if BOOST_PP_ITERATION_DEPTH() == 1
|
Chris@16
|
294
|
Chris@16
|
295 # define i_ BOOST_PP_FRAME_ITERATION(1)
|
Chris@16
|
296
|
Chris@16
|
297 template<
|
Chris@16
|
298 BOOST_MPL_PP_PARAMS(i_, typename N)
|
Chris@16
|
299 >
|
Chris@16
|
300 struct AUX778076_OP_NAME<BOOST_MPL_PP_PARTIAL_SPEC_PARAMS(i_, N, na)>
|
Chris@16
|
301 #if i_ != 2
|
Chris@16
|
302 : AUX778076_OP_N_CALLS(i_, N)
|
Chris@16
|
303 {
|
Chris@16
|
304 BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
|
Chris@16
|
305 AUX778076_OP_ARITY
|
Chris@16
|
306 , AUX778076_OP_NAME
|
Chris@16
|
307 , ( BOOST_MPL_PP_PARTIAL_SPEC_PARAMS(i_, N, na) )
|
Chris@16
|
308 )
|
Chris@16
|
309 };
|
Chris@16
|
310 #endif
|
Chris@16
|
311
|
Chris@16
|
312 # undef i_
|
Chris@16
|
313
|
Chris@16
|
314 #endif // BOOST_PP_ITERATION_DEPTH()
|
Chris@16
|
315 #endif // BOOST_PP_IS_ITERATING
|