2 // Copyright Aleksey Gurtovoy 2000-2004
\r
4 // Distributed under the Boost Software License, Version 1.0.
\r
5 // (See accompanying file LICENSE_1_0.txt or copy at
\r
6 // http://www.boost.org/LICENSE_1_0.txt)
\r
8 // See http://www.boost.org/libs/mpl for documentation.
\r
10 // $Id: logical_op.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
\r
11 // $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
\r
12 // $Revision: 49267 $
\r
14 // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION!
\r
16 #if !defined(BOOST_MPL_PREPROCESSING_MODE)
\r
17 # include <boost/mpl/bool.hpp>
\r
18 # include <boost/mpl/aux_/nested_type_wknd.hpp>
\r
19 # include <boost/mpl/aux_/na_spec.hpp>
\r
20 # include <boost/mpl/aux_/lambda_support.hpp>
\r
23 #include <boost/mpl/limits/arity.hpp>
\r
24 #include <boost/mpl/aux_/preprocessor/params.hpp>
\r
25 #include <boost/mpl/aux_/preprocessor/ext_params.hpp>
\r
26 #include <boost/mpl/aux_/preprocessor/def_params_tail.hpp>
\r
27 #include <boost/mpl/aux_/preprocessor/enum.hpp>
\r
28 #include <boost/mpl/aux_/preprocessor/sub.hpp>
\r
29 #include <boost/mpl/aux_/config/ctps.hpp>
\r
30 #include <boost/mpl/aux_/config/workaround.hpp>
\r
32 #include <boost/preprocessor/dec.hpp>
\r
33 #include <boost/preprocessor/inc.hpp>
\r
34 #include <boost/preprocessor/cat.hpp>
\r
36 namespace boost { namespace mpl {
\r
38 # define AUX778076_PARAMS(param, sub) \
\r
39 BOOST_MPL_PP_PARAMS( \
\r
40 BOOST_MPL_PP_SUB(BOOST_MPL_LIMIT_METAFUNCTION_ARITY, sub) \
\r
45 # define AUX778076_SHIFTED_PARAMS(param, sub) \
\r
46 BOOST_MPL_PP_EXT_PARAMS( \
\r
47 2, BOOST_MPL_PP_SUB(BOOST_PP_INC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY), sub) \
\r
52 # define AUX778076_SPEC_PARAMS(param) \
\r
53 BOOST_MPL_PP_ENUM( \
\r
54 BOOST_PP_DEC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY) \
\r
61 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
\r
63 template< bool C_, AUX778076_PARAMS(typename T, 1) >
\r
64 struct BOOST_PP_CAT(AUX778076_OP_NAME,impl)
\r
65 : BOOST_PP_CAT(AUX778076_OP_VALUE1,_)
\r
69 template< AUX778076_PARAMS(typename T, 1) >
\r
70 struct BOOST_PP_CAT(AUX778076_OP_NAME,impl)< AUX778076_OP_VALUE2,AUX778076_PARAMS(T, 1) >
\r
71 : BOOST_PP_CAT(AUX778076_OP_NAME,impl)<
\r
72 BOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value
\r
73 , AUX778076_SHIFTED_PARAMS(T, 1)
\r
74 , BOOST_PP_CAT(AUX778076_OP_VALUE2,_)
\r
80 struct BOOST_PP_CAT(AUX778076_OP_NAME,impl)<
\r
82 , AUX778076_SPEC_PARAMS(BOOST_PP_CAT(AUX778076_OP_VALUE2,_))
\r
84 : BOOST_PP_CAT(AUX778076_OP_VALUE2,_)
\r
90 template< bool C_ > struct BOOST_PP_CAT(AUX778076_OP_NAME,impl)
\r
92 template< AUX778076_PARAMS(typename T, 1) > struct result_
\r
93 : BOOST_PP_CAT(AUX778076_OP_VALUE1,_)
\r
98 template<> struct BOOST_PP_CAT(AUX778076_OP_NAME,impl)<AUX778076_OP_VALUE2>
\r
100 template< AUX778076_PARAMS(typename T, 1) > struct result_
\r
101 : BOOST_PP_CAT(AUX778076_OP_NAME,impl)<
\r
102 BOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value
\r
103 >::template result_< AUX778076_SHIFTED_PARAMS(T,1),BOOST_PP_CAT(AUX778076_OP_VALUE2,_) >
\r
107 #if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
\r
108 template<> struct result_<AUX778076_SPEC_PARAMS(BOOST_PP_CAT(AUX778076_OP_VALUE2,_))>
\r
109 : BOOST_PP_CAT(AUX778076_OP_VALUE2,_)
\r
117 struct BOOST_PP_CAT(AUX778076_OP_NAME,impl)<AUX778076_OP_VALUE2>
\r
118 ::result_< AUX778076_SPEC_PARAMS(BOOST_PP_CAT(AUX778076_OP_VALUE2,_)) >
\r
119 : BOOST_PP_CAT(AUX778076_OP_VALUE2,_)
\r
122 #endif // BOOST_MSVC == 1300
\r
124 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
\r
129 typename BOOST_MPL_AUX_NA_PARAM(T1)
\r
130 , typename BOOST_MPL_AUX_NA_PARAM(T2)
\r
131 BOOST_MPL_PP_DEF_PARAMS_TAIL(2, typename T, BOOST_PP_CAT(AUX778076_OP_VALUE2,_))
\r
133 struct AUX778076_OP_NAME
\r
134 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
\r
135 : aux::BOOST_PP_CAT(AUX778076_OP_NAME,impl)<
\r
136 BOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value
\r
137 , AUX778076_SHIFTED_PARAMS(T,0)
\r
140 : aux::BOOST_PP_CAT(AUX778076_OP_NAME,impl)<
\r
141 BOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value
\r
142 >::template result_< AUX778076_SHIFTED_PARAMS(T,0) >
\r
145 BOOST_MPL_AUX_LAMBDA_SUPPORT(
\r
146 BOOST_MPL_LIMIT_METAFUNCTION_ARITY
\r
147 , AUX778076_OP_NAME
\r
148 , (AUX778076_PARAMS(T, 0))
\r
152 BOOST_MPL_AUX_NA_SPEC2(
\r
154 , BOOST_MPL_LIMIT_METAFUNCTION_ARITY
\r
155 , AUX778076_OP_NAME
\r
160 #undef AUX778076_SPEC_PARAMS
\r
161 #undef AUX778076_SHIFTED_PARAMS
\r
162 #undef AUX778076_PARAMS
\r
163 #undef AUX778076_OP_NAME
\r
164 #undef AUX778076_OP_VALUE1
\r
165 #undef AUX778076_OP_VALUE2
\r