File indexing completed on 2025-01-18 09:43:27
0001
0002
0003
0004
0005
0006 #ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_NO_SPEC_OVERLOADS_HPP
0007 #define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_NO_SPEC_OVERLOADS_HPP
0008
0009 #include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
0010
0011
0012 #define BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_HEAD(name, is_const) \
0013 template <typename ResultType, typename Args> \
0014 BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name) ResultType \
0015 BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME( \
0016 name, is_const \
0017 )(ResultType(*)(), Args const& args)
0018
0019
0020 #include <boost/parameter/config.hpp>
0021
0022 #if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
0023
0024 #include <boost/parameter/aux_/preprocessor/impl/parenthesized_return_type.hpp>
0025
0026
0027 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0028 #define BOOST_PARAMETER_NO_SPEC_FUNCTION_HEAD(result, name, is_const) \
0029 template <typename TaggedArg0, typename ...TaggedArgs> \
0030 using BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME(name, is_const) \
0031 = typename BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(result);
0032
0033 #else
0034 #define BOOST_PARAMETER_NO_SPEC_FUNCTION_HEAD(result, name, is_const) \
0035 template <typename TaggedArg0, typename ...TaggedArgs> \
0036 struct BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME(name, is_const) \
0037 : BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(result) \
0038 { \
0039 };
0040
0041 #endif
0042
0043 #include <boost/parameter/compose.hpp>
0044 #include <boost/parameter/are_tagged_arguments.hpp>
0045 #include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
0046 #include <boost/core/enable_if.hpp>
0047
0048
0049
0050
0051
0052 #define BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(class_, base) \
0053 template < \
0054 typename TaggedArg0 \
0055 , typename ...TaggedArgs \
0056 , typename = typename ::boost::enable_if< \
0057 ::boost::parameter \
0058 ::are_tagged_arguments<TaggedArg0,TaggedArgs...> \
0059 >::type \
0060 > inline explicit \
0061 class_(TaggedArg0 const& arg0, TaggedArgs const&... args) \
0062 : BOOST_PARAMETER_PARENTHESIZED_TYPE(base)( \
0063 ::boost::parameter::compose(arg0, args...) \
0064 ) \
0065 { \
0066 }
0067
0068
0069
0070
0071
0072 #define BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(class_, func) \
0073 template < \
0074 typename TaggedArg0 \
0075 , typename ...TaggedArgs \
0076 , typename = typename ::boost::enable_if< \
0077 ::boost::parameter \
0078 ::are_tagged_arguments<TaggedArg0,TaggedArgs...> \
0079 >::type \
0080 > inline explicit \
0081 class_(TaggedArg0 const& arg0, TaggedArgs const&... args) \
0082 { \
0083 func(::boost::parameter::compose(arg0, args...)); \
0084 }
0085
0086
0087 #include <boost/parameter/aux_/preprocessor/nullptr.hpp>
0088 #include <boost/preprocessor/control/expr_if.hpp>
0089
0090
0091
0092 #define BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD(name, impl, is_m, c) \
0093 template <typename TaggedArg0, typename ...TaggedArgs> \
0094 BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(impl) \
0095 inline typename ::boost::lazy_enable_if< \
0096 ::boost::parameter \
0097 ::are_tagged_arguments<TaggedArg0,TaggedArgs...> \
0098 , BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
0099 impl, c \
0100 )<TaggedArg0,TaggedArgs...> \
0101 >::type BOOST_PARAMETER_MEMBER_FUNCTION_NAME(name) \
0102 (TaggedArg0 const& arg0, TaggedArgs const&... args) \
0103 BOOST_PP_EXPR_IF(c, const) \
0104 { \
0105 return BOOST_PP_EXPR_IF(is_m, this->) \
0106 BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME(impl, c)( \
0107 static_cast< \
0108 typename BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
0109 impl, c \
0110 )<TaggedArg0,TaggedArgs...>::type(*)() \
0111 >(BOOST_PARAMETER_AUX_PP_NULLPTR) \
0112 , ::boost::parameter::compose(arg0, args...) \
0113 ); \
0114 }
0115
0116
0117 #else
0118
0119 #include <boost/parameter/aux_/void.hpp>
0120 #include <boost/parameter/aux_/preprocessor/impl/parenthesized_return_type.hpp>
0121 #include <boost/preprocessor/facilities/intercept.hpp>
0122 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
0123
0124
0125 #define BOOST_PARAMETER_NO_SPEC_FUNCTION_HEAD(result, name, is_const) \
0126 template < \
0127 BOOST_PP_ENUM_BINARY_PARAMS( \
0128 BOOST_PARAMETER_COMPOSE_MAX_ARITY \
0129 , typename TaggedArg \
0130 , = ::boost::parameter::void_ BOOST_PP_INTERCEPT \
0131 ) \
0132 > \
0133 struct BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME(name, is_const) \
0134 : BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(result) \
0135 { \
0136 };
0137
0138
0139 #include <boost/parameter/compose.hpp>
0140 #include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
0141 #include <boost/preprocessor/comparison/equal.hpp>
0142 #include <boost/preprocessor/control/expr_if.hpp>
0143 #include <boost/preprocessor/repetition/enum_params.hpp>
0144 #include <boost/preprocessor/tuple/elem.hpp>
0145
0146 #if defined(BOOST_NO_SFINAE)
0147
0148
0149
0150 #define BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
0151 template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
0152 BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) inline \
0153 BOOST_PP_TUPLE_ELEM(2, 0, data)( \
0154 BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& arg) \
0155 ) : BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(2, 1, data))( \
0156 ::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, arg)) \
0157 ) \
0158 { \
0159 }
0160
0161
0162
0163
0164 #define BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
0165 template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
0166 BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) inline \
0167 BOOST_PP_TUPLE_ELEM(2, 0, data)( \
0168 BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& a) \
0169 ) \
0170 { \
0171 BOOST_PP_TUPLE_ELEM(2, 1, data)( \
0172 ::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, a)) \
0173 ); \
0174 }
0175
0176
0177 #include <boost/parameter/aux_/preprocessor/nullptr.hpp>
0178
0179
0180 #define BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD_Z(z, n, data) \
0181 template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
0182 BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4, 1, data)) \
0183 inline typename BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
0184 BOOST_PP_TUPLE_ELEM(4, 1, data) \
0185 , BOOST_PP_TUPLE_ELEM(4, 3, data) \
0186 )<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)>::type \
0187 BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
0188 BOOST_PP_TUPLE_ELEM(4, 0, data) \
0189 )(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& arg)) \
0190 BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 3, data), const) \
0191 { \
0192 return BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 2, data), this->) \
0193 BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME( \
0194 BOOST_PP_TUPLE_ELEM(4, 1, data) \
0195 , BOOST_PP_TUPLE_ELEM(4, 3, data) \
0196 )( \
0197 static_cast< \
0198 typename BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
0199 BOOST_PP_TUPLE_ELEM(4, 1, data) \
0200 , BOOST_PP_TUPLE_ELEM(4, 3, data) \
0201 )<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)>::type(*)() \
0202 >(BOOST_PARAMETER_AUX_PP_NULLPTR) \
0203 , ::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, arg)) \
0204 ); \
0205 }
0206
0207
0208 #else
0209
0210 #include <boost/parameter/are_tagged_arguments.hpp>
0211 #include <boost/parameter/aux_/preprocessor/nullptr.hpp>
0212 #include <boost/core/enable_if.hpp>
0213
0214
0215
0216
0217 #define BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
0218 template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
0219 BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) inline \
0220 BOOST_PP_TUPLE_ELEM(2, 0, data)( \
0221 BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& arg) \
0222 , typename ::boost::enable_if< \
0223 ::boost::parameter::are_tagged_arguments< \
0224 BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg) \
0225 > \
0226 >::type* = BOOST_PARAMETER_AUX_PP_NULLPTR \
0227 ) : BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(2, 1, data))( \
0228 ::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, arg)) \
0229 ) \
0230 { \
0231 }
0232
0233
0234
0235
0236
0237 #define BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
0238 template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
0239 BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) inline \
0240 BOOST_PP_TUPLE_ELEM(2, 0, data)( \
0241 BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& a) \
0242 , typename ::boost::enable_if< \
0243 ::boost::parameter::are_tagged_arguments< \
0244 BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg) \
0245 > \
0246 >::type* = BOOST_PARAMETER_AUX_PP_NULLPTR \
0247 ) \
0248 { \
0249 BOOST_PP_TUPLE_ELEM(2, 1, data)( \
0250 ::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, a)) \
0251 ); \
0252 }
0253
0254
0255
0256
0257 #define BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD_Z(z, n, data) \
0258 template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
0259 BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4, 1, data)) \
0260 inline typename ::boost::lazy_enable_if< \
0261 ::boost::parameter \
0262 ::are_tagged_arguments<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)> \
0263 , BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
0264 BOOST_PP_TUPLE_ELEM(4, 1, data) \
0265 , BOOST_PP_TUPLE_ELEM(4, 3, data) \
0266 )<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)> \
0267 >::type BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
0268 BOOST_PP_TUPLE_ELEM(4, 0, data) \
0269 )(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& arg)) \
0270 BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 3, data), const) \
0271 { \
0272 return BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 2, data), this->) \
0273 BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME( \
0274 BOOST_PP_TUPLE_ELEM(4, 1, data) \
0275 , BOOST_PP_TUPLE_ELEM(4, 3, data) \
0276 )( \
0277 static_cast< \
0278 typename BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
0279 BOOST_PP_TUPLE_ELEM(4, 1, data) \
0280 , BOOST_PP_TUPLE_ELEM(4, 3, data) \
0281 )<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)>::type(*)() \
0282 >(BOOST_PARAMETER_AUX_PP_NULLPTR) \
0283 , ::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, arg)) \
0284 ); \
0285 }
0286
0287
0288 #endif
0289
0290 #include <boost/preprocessor/arithmetic/inc.hpp>
0291 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
0292
0293
0294
0295
0296
0297 #define BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(class_, base) \
0298 BOOST_PP_REPEAT_FROM_TO( \
0299 1 \
0300 , BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY) \
0301 , BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR_OVERLOAD_Z \
0302 , (class_, base) \
0303 )
0304
0305
0306
0307
0308
0309 #define BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(class_, func) \
0310 BOOST_PP_REPEAT_FROM_TO( \
0311 1 \
0312 , BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY) \
0313 , BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR_OVERLOAD_Z \
0314 , (class_, func) \
0315 )
0316
0317
0318
0319
0320 #define BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD(name, impl, is_m, c) \
0321 BOOST_PP_REPEAT_FROM_TO( \
0322 1 \
0323 , BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY) \
0324 , BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD_Z \
0325 , (name, impl, is_m, c) \
0326 )
0327
0328
0329 #endif
0330 #endif
0331