File indexing completed on 2025-12-16 09:57:05
0001
0002 #ifndef BOOST_MPL_AUX_NA_SPEC_HPP_INCLUDED
0003 #define BOOST_MPL_AUX_NA_SPEC_HPP_INCLUDED
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #if !defined(BOOST_MPL_PREPROCESSING_MODE)
0018 # include <boost/mpl/lambda_fwd.hpp>
0019 # include <boost/mpl/int.hpp>
0020 # include <boost/mpl/bool.hpp>
0021 # include <boost/mpl/aux_/na.hpp>
0022 # include <boost/mpl/aux_/arity.hpp>
0023 # include <boost/mpl/aux_/template_arity_fwd.hpp>
0024 #endif
0025
0026 #include <boost/mpl/aux_/preprocessor/params.hpp>
0027 #include <boost/mpl/aux_/preprocessor/enum.hpp>
0028 #include <boost/mpl/aux_/preprocessor/def_params_tail.hpp>
0029 #include <boost/mpl/aux_/lambda_arity_param.hpp>
0030 #include <boost/mpl/aux_/config/dtp.hpp>
0031 #include <boost/mpl/aux_/config/eti.hpp>
0032 #include <boost/mpl/aux_/nttp_decl.hpp>
0033 #include <boost/mpl/aux_/config/ttp.hpp>
0034 #include <boost/mpl/aux_/config/lambda.hpp>
0035 #include <boost/mpl/aux_/config/overload_resolution.hpp>
0036
0037
0038 #define BOOST_MPL_AUX_NA_PARAMS(i) \
0039 BOOST_MPL_PP_ENUM(i, na) \
0040
0041
0042 #if defined(BOOST_MPL_CFG_BROKEN_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
0043 # define BOOST_MPL_AUX_NA_SPEC_ARITY(i, name) \
0044 namespace aux { \
0045 template< BOOST_MPL_AUX_NTTP_DECL(int, N) > \
0046 struct arity< \
0047 name< BOOST_MPL_AUX_NA_PARAMS(i) > \
0048 , N \
0049 > \
0050 : int_< BOOST_MPL_LIMIT_METAFUNCTION_ARITY > \
0051 { \
0052 }; \
0053 } \
0054
0055 #else
0056 # define BOOST_MPL_AUX_NA_SPEC_ARITY(i, name)
0057 #endif
0058
0059 #define BOOST_MPL_AUX_NA_SPEC_MAIN(i, name) \
0060 template<> \
0061 struct name< BOOST_MPL_AUX_NA_PARAMS(i) > \
0062 { \
0063 template< \
0064 BOOST_MPL_PP_PARAMS(i, typename T) \
0065 BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, typename T, na) \
0066 > \
0067 struct apply \
0068 : name< BOOST_MPL_PP_PARAMS(i, T) > \
0069 { \
0070 }; \
0071 }; \
0072
0073
0074 #if defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT)
0075 # define BOOST_MPL_AUX_NA_SPEC_LAMBDA(i, name) \
0076 template<> \
0077 struct lambda< \
0078 name< BOOST_MPL_AUX_NA_PARAMS(i) > \
0079 , void_ \
0080 , true_ \
0081 > \
0082 { \
0083 typedef false_ is_le; \
0084 typedef name< BOOST_MPL_AUX_NA_PARAMS(i) > type; \
0085 }; \
0086 template<> \
0087 struct lambda< \
0088 name< BOOST_MPL_AUX_NA_PARAMS(i) > \
0089 , void_ \
0090 , false_ \
0091 > \
0092 { \
0093 typedef false_ is_le; \
0094 typedef name< BOOST_MPL_AUX_NA_PARAMS(i) > type; \
0095 }; \
0096
0097 #else
0098 # define BOOST_MPL_AUX_NA_SPEC_LAMBDA(i, name) \
0099 template< typename Tag > \
0100 struct lambda< \
0101 name< BOOST_MPL_AUX_NA_PARAMS(i) > \
0102 , Tag \
0103 BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(int_<-1>) \
0104 > \
0105 { \
0106 typedef false_ is_le; \
0107 typedef name< BOOST_MPL_AUX_NA_PARAMS(i) > result_; \
0108 typedef name< BOOST_MPL_AUX_NA_PARAMS(i) > type; \
0109 }; \
0110
0111 #endif
0112
0113 #if defined(BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) \
0114 || defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT) \
0115 && defined(BOOST_MPL_CFG_BROKEN_OVERLOAD_RESOLUTION)
0116 # define BOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(i, j, name) \
0117 namespace aux { \
0118 template< BOOST_MPL_PP_PARAMS(j, typename T) > \
0119 struct template_arity< \
0120 name< BOOST_MPL_PP_PARAMS(j, T) > \
0121 > \
0122 : int_<j> \
0123 { \
0124 }; \
0125 \
0126 template<> \
0127 struct template_arity< \
0128 name< BOOST_MPL_PP_ENUM(i, na) > \
0129 > \
0130 : int_<-1> \
0131 { \
0132 }; \
0133 } \
0134
0135 #else
0136 # define BOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(i, j, name)
0137 #endif
0138
0139 #if defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
0140 # define BOOST_MPL_AUX_NA_SPEC_ETI(i, name) \
0141 template<> \
0142 struct name< BOOST_MPL_PP_ENUM(i, int) > \
0143 { \
0144 typedef int type; \
0145 enum { value = 0 }; \
0146 }; \
0147
0148 #else
0149 # define BOOST_MPL_AUX_NA_SPEC_ETI(i, name)
0150 #endif
0151
0152 #define BOOST_MPL_AUX_NA_PARAM(param) param = na
0153
0154 #define BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
0155 BOOST_MPL_AUX_NA_SPEC_MAIN(i, name) \
0156 BOOST_MPL_AUX_NA_SPEC_LAMBDA(i, name) \
0157 BOOST_MPL_AUX_NA_SPEC_ARITY(i, name) \
0158 BOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(i, i, name) \
0159
0160
0161 #define BOOST_MPL_AUX_NA_SPEC(i, name) \
0162 BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
0163 BOOST_MPL_AUX_NA_SPEC_ETI(i, name) \
0164
0165
0166 #define BOOST_MPL_AUX_NA_SPEC2(i, j, name) \
0167 BOOST_MPL_AUX_NA_SPEC_MAIN(i, name) \
0168 BOOST_MPL_AUX_NA_SPEC_ETI(i, name) \
0169 BOOST_MPL_AUX_NA_SPEC_LAMBDA(i, name) \
0170 BOOST_MPL_AUX_NA_SPEC_ARITY(i, name) \
0171 BOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(i, j, name) \
0172
0173
0174
0175 #endif