Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1 | |
| 2 | // Copyright Aleksey Gurtovoy 2000-2004 |
| 3 | // |
| 4 | // Distributed under the Boost Software License, Version 1.0. |
| 5 | // (See accompanying file LICENSE_1_0.txt or copy at |
| 6 | // http://www.boost.org/LICENSE_1_0.txt) |
| 7 | // |
| 8 | // See http://www.boost.org/libs/mpl for documentation. |
| 9 | |
| 10 | // $Id: logical_op.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ |
| 11 | // $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $ |
| 12 | // $Revision: 49267 $ |
| 13 | |
| 14 | // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION! |
| 15 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 16 | #if !defined(NDNBOOST_MPL_PREPROCESSING_MODE) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 17 | # include <ndnboost/mpl/bool.hpp> |
| 18 | # include <ndnboost/mpl/aux_/nested_type_wknd.hpp> |
| 19 | # include <ndnboost/mpl/aux_/na_spec.hpp> |
| 20 | # include <ndnboost/mpl/aux_/lambda_support.hpp> |
| 21 | #endif |
| 22 | |
| 23 | #include <ndnboost/mpl/limits/arity.hpp> |
| 24 | #include <ndnboost/mpl/aux_/preprocessor/params.hpp> |
| 25 | #include <ndnboost/mpl/aux_/preprocessor/ext_params.hpp> |
| 26 | #include <ndnboost/mpl/aux_/preprocessor/def_params_tail.hpp> |
| 27 | #include <ndnboost/mpl/aux_/preprocessor/enum.hpp> |
| 28 | #include <ndnboost/mpl/aux_/preprocessor/sub.hpp> |
| 29 | #include <ndnboost/mpl/aux_/config/ctps.hpp> |
| 30 | #include <ndnboost/mpl/aux_/config/workaround.hpp> |
| 31 | |
| 32 | #include <ndnboost/preprocessor/dec.hpp> |
| 33 | #include <ndnboost/preprocessor/inc.hpp> |
| 34 | #include <ndnboost/preprocessor/cat.hpp> |
| 35 | |
| 36 | namespace ndnboost { namespace mpl { |
| 37 | |
| 38 | # define AUX778076_PARAMS(param, sub) \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 39 | NDNBOOST_MPL_PP_PARAMS( \ |
| 40 | NDNBOOST_MPL_PP_SUB(NDNBOOST_MPL_LIMIT_METAFUNCTION_ARITY, sub) \ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 41 | , param \ |
| 42 | ) \ |
| 43 | /**/ |
| 44 | |
| 45 | # define AUX778076_SHIFTED_PARAMS(param, sub) \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 46 | NDNBOOST_MPL_PP_EXT_PARAMS( \ |
| 47 | 2, NDNBOOST_MPL_PP_SUB(NDNBOOST_PP_INC(NDNBOOST_MPL_LIMIT_METAFUNCTION_ARITY), sub) \ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 48 | , param \ |
| 49 | ) \ |
| 50 | /**/ |
| 51 | |
| 52 | # define AUX778076_SPEC_PARAMS(param) \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 53 | NDNBOOST_MPL_PP_ENUM( \ |
| 54 | NDNBOOST_PP_DEC(NDNBOOST_MPL_LIMIT_METAFUNCTION_ARITY) \ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 55 | , param \ |
| 56 | ) \ |
| 57 | /**/ |
| 58 | |
| 59 | namespace aux { |
| 60 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 61 | #if !defined(NDNBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 62 | |
| 63 | template< bool C_, AUX778076_PARAMS(typename T, 1) > |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 64 | struct NDNBOOST_PP_CAT(AUX778076_OP_NAME,impl) |
| 65 | : NDNBOOST_PP_CAT(AUX778076_OP_VALUE1,_) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 66 | { |
| 67 | }; |
| 68 | |
| 69 | template< AUX778076_PARAMS(typename T, 1) > |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 70 | struct NDNBOOST_PP_CAT(AUX778076_OP_NAME,impl)< AUX778076_OP_VALUE2,AUX778076_PARAMS(T, 1) > |
| 71 | : NDNBOOST_PP_CAT(AUX778076_OP_NAME,impl)< |
| 72 | NDNBOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 73 | , AUX778076_SHIFTED_PARAMS(T, 1) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 74 | , NDNBOOST_PP_CAT(AUX778076_OP_VALUE2,_) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 75 | > |
| 76 | { |
| 77 | }; |
| 78 | |
| 79 | template<> |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 80 | struct NDNBOOST_PP_CAT(AUX778076_OP_NAME,impl)< |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 81 | AUX778076_OP_VALUE2 |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 82 | , AUX778076_SPEC_PARAMS(NDNBOOST_PP_CAT(AUX778076_OP_VALUE2,_)) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 83 | > |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 84 | : NDNBOOST_PP_CAT(AUX778076_OP_VALUE2,_) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 85 | { |
| 86 | }; |
| 87 | |
| 88 | #else |
| 89 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 90 | template< bool C_ > struct NDNBOOST_PP_CAT(AUX778076_OP_NAME,impl) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 91 | { |
| 92 | template< AUX778076_PARAMS(typename T, 1) > struct result_ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 93 | : NDNBOOST_PP_CAT(AUX778076_OP_VALUE1,_) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 94 | { |
| 95 | }; |
| 96 | }; |
| 97 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 98 | template<> struct NDNBOOST_PP_CAT(AUX778076_OP_NAME,impl)<AUX778076_OP_VALUE2> |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 99 | { |
| 100 | template< AUX778076_PARAMS(typename T, 1) > struct result_ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 101 | : NDNBOOST_PP_CAT(AUX778076_OP_NAME,impl)< |
| 102 | NDNBOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value |
| 103 | >::template result_< AUX778076_SHIFTED_PARAMS(T,1),NDNBOOST_PP_CAT(AUX778076_OP_VALUE2,_) > |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 104 | { |
| 105 | }; |
| 106 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 107 | #if NDNBOOST_WORKAROUND(NDNBOOST_MSVC, == 1300) |
| 108 | template<> struct result_<AUX778076_SPEC_PARAMS(NDNBOOST_PP_CAT(AUX778076_OP_VALUE2,_))> |
| 109 | : NDNBOOST_PP_CAT(AUX778076_OP_VALUE2,_) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 110 | { |
| 111 | }; |
| 112 | }; |
| 113 | #else |
| 114 | }; |
| 115 | |
| 116 | template<> |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 117 | struct NDNBOOST_PP_CAT(AUX778076_OP_NAME,impl)<AUX778076_OP_VALUE2> |
| 118 | ::result_< AUX778076_SPEC_PARAMS(NDNBOOST_PP_CAT(AUX778076_OP_VALUE2,_)) > |
| 119 | : NDNBOOST_PP_CAT(AUX778076_OP_VALUE2,_) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 120 | { |
| 121 | }; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 122 | #endif // NDNBOOST_MSVC == 1300 |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 123 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 124 | #endif // NDNBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 125 | |
| 126 | } // namespace aux |
| 127 | |
| 128 | template< |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 129 | typename NDNBOOST_MPL_AUX_NA_PARAM(T1) |
| 130 | , typename NDNBOOST_MPL_AUX_NA_PARAM(T2) |
| 131 | NDNBOOST_MPL_PP_DEF_PARAMS_TAIL(2, typename T, NDNBOOST_PP_CAT(AUX778076_OP_VALUE2,_)) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 132 | > |
| 133 | struct AUX778076_OP_NAME |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 134 | #if !defined(NDNBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) |
| 135 | : aux::NDNBOOST_PP_CAT(AUX778076_OP_NAME,impl)< |
| 136 | NDNBOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 137 | , AUX778076_SHIFTED_PARAMS(T,0) |
| 138 | > |
| 139 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 140 | : aux::NDNBOOST_PP_CAT(AUX778076_OP_NAME,impl)< |
| 141 | NDNBOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 142 | >::template result_< AUX778076_SHIFTED_PARAMS(T,0) > |
| 143 | #endif |
| 144 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 145 | NDNBOOST_MPL_AUX_LAMBDA_SUPPORT( |
| 146 | NDNBOOST_MPL_LIMIT_METAFUNCTION_ARITY |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 147 | , AUX778076_OP_NAME |
| 148 | , (AUX778076_PARAMS(T, 0)) |
| 149 | ) |
| 150 | }; |
| 151 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 152 | NDNBOOST_MPL_AUX_NA_SPEC2( |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 153 | 2 |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 154 | , NDNBOOST_MPL_LIMIT_METAFUNCTION_ARITY |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 155 | , AUX778076_OP_NAME |
| 156 | ) |
| 157 | |
| 158 | }} |
| 159 | |
| 160 | #undef AUX778076_SPEC_PARAMS |
| 161 | #undef AUX778076_SHIFTED_PARAMS |
| 162 | #undef AUX778076_PARAMS |
| 163 | #undef AUX778076_OP_NAME |
| 164 | #undef AUX778076_OP_VALUE1 |
| 165 | #undef AUX778076_OP_VALUE2 |