Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 1 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 2 | #ifndef NDNBOOST_MPL_AUX_NA_SPEC_HPP_INCLUDED |
| 3 | #define NDNBOOST_MPL_AUX_NA_SPEC_HPP_INCLUDED |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 4 | |
| 5 | // Copyright Aleksey Gurtovoy 2001-2004 |
| 6 | // |
| 7 | // Distributed under the Boost Software License, Version 1.0. |
| 8 | // (See accompanying file LICENSE_1_0.txt or copy at |
| 9 | // http://www.boost.org/LICENSE_1_0.txt) |
| 10 | // |
| 11 | // See http://www.boost.org/libs/mpl for documentation. |
| 12 | |
| 13 | // $Id: na_spec.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ |
| 14 | // $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $ |
| 15 | // $Revision: 49267 $ |
| 16 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 17 | #if !defined(NDNBOOST_MPL_PREPROCESSING_MODE) |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 18 | # include <ndnboost/mpl/lambda_fwd.hpp> |
| 19 | # include <ndnboost/mpl/int.hpp> |
| 20 | # include <ndnboost/mpl/bool.hpp> |
| 21 | # include <ndnboost/mpl/aux_/na.hpp> |
| 22 | # include <ndnboost/mpl/aux_/arity.hpp> |
| 23 | # include <ndnboost/mpl/aux_/template_arity_fwd.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 24 | #endif |
| 25 | |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 26 | #include <ndnboost/mpl/aux_/preprocessor/params.hpp> |
| 27 | #include <ndnboost/mpl/aux_/preprocessor/enum.hpp> |
| 28 | #include <ndnboost/mpl/aux_/preprocessor/def_params_tail.hpp> |
| 29 | #include <ndnboost/mpl/aux_/lambda_arity_param.hpp> |
| 30 | #include <ndnboost/mpl/aux_/config/dtp.hpp> |
| 31 | #include <ndnboost/mpl/aux_/config/eti.hpp> |
| 32 | #include <ndnboost/mpl/aux_/nttp_decl.hpp> |
| 33 | #include <ndnboost/mpl/aux_/config/ttp.hpp> |
| 34 | #include <ndnboost/mpl/aux_/config/lambda.hpp> |
| 35 | #include <ndnboost/mpl/aux_/config/overload_resolution.hpp> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 36 | |
| 37 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 38 | #define NDNBOOST_MPL_AUX_NA_PARAMS(i) \ |
| 39 | NDNBOOST_MPL_PP_ENUM(i, na) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 40 | /**/ |
| 41 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 42 | #if defined(NDNBOOST_MPL_CFG_BROKEN_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES) |
| 43 | # define NDNBOOST_MPL_AUX_NA_SPEC_ARITY(i, name) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 44 | namespace aux { \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 45 | template< NDNBOOST_MPL_AUX_NTTP_DECL(int, N) > \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 46 | struct arity< \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 47 | name< NDNBOOST_MPL_AUX_NA_PARAMS(i) > \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 48 | , N \ |
| 49 | > \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 50 | : int_< NDNBOOST_MPL_LIMIT_METAFUNCTION_ARITY > \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 51 | { \ |
| 52 | }; \ |
| 53 | } \ |
| 54 | /**/ |
| 55 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 56 | # define NDNBOOST_MPL_AUX_NA_SPEC_ARITY(i, name) /**/ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 57 | #endif |
| 58 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 59 | #define NDNBOOST_MPL_AUX_NA_SPEC_MAIN(i, name) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 60 | template<> \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 61 | struct name< NDNBOOST_MPL_AUX_NA_PARAMS(i) > \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 62 | { \ |
| 63 | template< \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 64 | NDNBOOST_MPL_PP_PARAMS(i, typename T) \ |
| 65 | NDNBOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, typename T, na) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 66 | > \ |
| 67 | struct apply \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 68 | : name< NDNBOOST_MPL_PP_PARAMS(i, T) > \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 69 | { \ |
| 70 | }; \ |
| 71 | }; \ |
| 72 | /**/ |
| 73 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 74 | #if defined(NDNBOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT) |
| 75 | # define NDNBOOST_MPL_AUX_NA_SPEC_LAMBDA(i, name) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 76 | template<> \ |
| 77 | struct lambda< \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 78 | name< NDNBOOST_MPL_AUX_NA_PARAMS(i) > \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 79 | , void_ \ |
| 80 | , true_ \ |
| 81 | > \ |
| 82 | { \ |
| 83 | typedef false_ is_le; \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 84 | typedef name< NDNBOOST_MPL_AUX_NA_PARAMS(i) > type; \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 85 | }; \ |
| 86 | template<> \ |
| 87 | struct lambda< \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 88 | name< NDNBOOST_MPL_AUX_NA_PARAMS(i) > \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 89 | , void_ \ |
| 90 | , false_ \ |
| 91 | > \ |
| 92 | { \ |
| 93 | typedef false_ is_le; \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 94 | typedef name< NDNBOOST_MPL_AUX_NA_PARAMS(i) > type; \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 95 | }; \ |
| 96 | /**/ |
| 97 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 98 | # define NDNBOOST_MPL_AUX_NA_SPEC_LAMBDA(i, name) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 99 | template< typename Tag > \ |
| 100 | struct lambda< \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 101 | name< NDNBOOST_MPL_AUX_NA_PARAMS(i) > \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 102 | , Tag \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 103 | NDNBOOST_MPL_AUX_LAMBDA_ARITY_PARAM(int_<-1>) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 104 | > \ |
| 105 | { \ |
| 106 | typedef false_ is_le; \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 107 | typedef name< NDNBOOST_MPL_AUX_NA_PARAMS(i) > result_; \ |
| 108 | typedef name< NDNBOOST_MPL_AUX_NA_PARAMS(i) > type; \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 109 | }; \ |
| 110 | /**/ |
| 111 | #endif |
| 112 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 113 | #if defined(NDNBOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) \ |
| 114 | || defined(NDNBOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT) \ |
| 115 | && defined(NDNBOOST_MPL_CFG_BROKEN_OVERLOAD_RESOLUTION) |
| 116 | # define NDNBOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(i, j, name) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 117 | namespace aux { \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 118 | template< NDNBOOST_MPL_PP_PARAMS(j, typename T) > \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 119 | struct template_arity< \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 120 | name< NDNBOOST_MPL_PP_PARAMS(j, T) > \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 121 | > \ |
| 122 | : int_<j> \ |
| 123 | { \ |
| 124 | }; \ |
| 125 | \ |
| 126 | template<> \ |
| 127 | struct template_arity< \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 128 | name< NDNBOOST_MPL_PP_ENUM(i, na) > \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 129 | > \ |
| 130 | : int_<-1> \ |
| 131 | { \ |
| 132 | }; \ |
| 133 | } \ |
| 134 | /**/ |
| 135 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 136 | # define NDNBOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(i, j, name) /**/ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 137 | #endif |
| 138 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 139 | #if defined(NDNBOOST_MPL_CFG_MSVC_ETI_BUG) |
| 140 | # define NDNBOOST_MPL_AUX_NA_SPEC_ETI(i, name) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 141 | template<> \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 142 | struct name< NDNBOOST_MPL_PP_ENUM(i, int) > \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 143 | { \ |
| 144 | typedef int type; \ |
| 145 | enum { value = 0 }; \ |
| 146 | }; \ |
| 147 | /**/ |
| 148 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 149 | # define NDNBOOST_MPL_AUX_NA_SPEC_ETI(i, name) /**/ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 150 | #endif |
| 151 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 152 | #define NDNBOOST_MPL_AUX_NA_PARAM(param) param = na |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 153 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 154 | #define NDNBOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \ |
| 155 | NDNBOOST_MPL_AUX_NA_SPEC_MAIN(i, name) \ |
| 156 | NDNBOOST_MPL_AUX_NA_SPEC_LAMBDA(i, name) \ |
| 157 | NDNBOOST_MPL_AUX_NA_SPEC_ARITY(i, name) \ |
| 158 | NDNBOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(i, i, name) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 159 | /**/ |
| 160 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 161 | #define NDNBOOST_MPL_AUX_NA_SPEC(i, name) \ |
| 162 | NDNBOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \ |
| 163 | NDNBOOST_MPL_AUX_NA_SPEC_ETI(i, name) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 164 | /**/ |
| 165 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 166 | #define NDNBOOST_MPL_AUX_NA_SPEC2(i, j, name) \ |
| 167 | NDNBOOST_MPL_AUX_NA_SPEC_MAIN(i, name) \ |
| 168 | NDNBOOST_MPL_AUX_NA_SPEC_ETI(i, name) \ |
| 169 | NDNBOOST_MPL_AUX_NA_SPEC_LAMBDA(i, name) \ |
| 170 | NDNBOOST_MPL_AUX_NA_SPEC_ARITY(i, name) \ |
| 171 | NDNBOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(i, j, name) \ |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 172 | /**/ |
| 173 | |
| 174 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 175 | #endif // NDNBOOST_MPL_AUX_NA_SPEC_HPP_INCLUDED |