File indexing completed on 2025-01-18 09:43:30
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_PARAMETERS_031014_HPP
0008 #define BOOST_PARAMETERS_031014_HPP
0009
0010 #include <boost/parameter/config.hpp>
0011
0012 #if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
0013
0014 namespace boost { namespace parameter { namespace aux {
0015
0016
0017
0018 template <typename ArgList, typename ...Args>
0019 struct arg_list_factory;
0020 }}}
0021
0022 #include <boost/parameter/aux_/arg_list.hpp>
0023 #include <utility>
0024
0025 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0026 #include <boost/mp11/utility.hpp>
0027 #include <type_traits>
0028 #else
0029 #include <boost/mpl/if.hpp>
0030 #include <boost/type_traits/is_same.hpp>
0031 #endif
0032
0033 namespace boost { namespace parameter { namespace aux {
0034
0035
0036 template <typename ArgList>
0037 struct arg_list_factory<ArgList>
0038 {
0039 template <typename ...ReversedArgs>
0040 static inline BOOST_CONSTEXPR ArgList
0041 reverse(ReversedArgs&&... reversed_args)
0042 {
0043 return ArgList(
0044 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0045 ::boost::mp11::mp_if<
0046 ::std::is_same<
0047 #else
0048 typename ::boost::mpl::if_<
0049 ::boost::is_same<
0050 #endif
0051 typename ArgList::tagged_arg::value_type
0052 , ::boost::parameter::void_
0053 >
0054 , ::boost::parameter::aux::value_type_is_void
0055 , ::boost::parameter::aux::value_type_is_not_void
0056 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0057 >()
0058 #else
0059 >::type()
0060 #endif
0061 , ::std::forward<ReversedArgs>(reversed_args)...
0062 );
0063 }
0064 };
0065
0066 template <typename ArgList, typename A0, typename ...Args>
0067 struct arg_list_factory<ArgList,A0,Args...>
0068 {
0069 template <typename ...ReversedArgs>
0070 static inline BOOST_CONSTEXPR ArgList
0071 reverse(A0&& a0, Args&&... args, ReversedArgs&&... reversed_args)
0072 {
0073 return ::boost::parameter::aux
0074 ::arg_list_factory<ArgList,Args...>::reverse(
0075 ::std::forward<Args>(args)...
0076 , ::std::forward<A0>(a0)
0077 , ::std::forward<ReversedArgs>(reversed_args)...
0078 );
0079 }
0080 };
0081 }}}
0082
0083 #include <boost/parameter/aux_/void.hpp>
0084 #include <boost/parameter/aux_/pack/make_arg_list.hpp>
0085 #include <boost/parameter/aux_/pack/make_parameter_spec_items.hpp>
0086 #include <boost/parameter/aux_/pack/tag_keyword_arg.hpp>
0087 #include <boost/parameter/aux_/pack/tag_template_keyword_arg.hpp>
0088
0089 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0090 #include <boost/mp11/integral.hpp>
0091 #include <boost/mp11/list.hpp>
0092 #else
0093 #include <boost/mpl/bool.hpp>
0094 #include <boost/mpl/pair.hpp>
0095 #include <boost/mpl/identity.hpp>
0096 #endif
0097
0098 #if !defined(BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE)
0099 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0100
0101 #define BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE ::boost::mp11::mp_list
0102 #else
0103 #include <boost/fusion/container/list/list_fwd.hpp>
0104
0105
0106
0107
0108
0109 #if defined(BOOST_FUSION_HAS_VARIADIC_LIST) && ( \
0110 !defined(BOOST_MSVC) || (BOOST_MSVC < 1800) \
0111 )
0112 #include <boost/fusion/container/list.hpp>
0113 #include <boost/fusion/mpl.hpp>
0114 #define BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE ::boost::fusion::list
0115 #else
0116 #include <boost/fusion/container/deque/deque_fwd.hpp>
0117
0118 #if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE)
0119 #include <boost/fusion/container/deque.hpp>
0120 #include <boost/fusion/mpl.hpp>
0121 #define BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE ::boost::fusion::deque
0122 #else
0123 #include <boost/mpl/vector.hpp>
0124 #define BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE ::boost::mpl::vector
0125 #endif
0126 #endif
0127 #endif
0128 #endif
0129
0130 namespace boost { namespace parameter {
0131
0132 template <typename ...Spec>
0133 struct parameters
0134 {
0135 typedef BOOST_PARAMETER_VARIADIC_MPL_SEQUENCE<Spec...> parameter_spec;
0136
0137 typedef typename ::boost::parameter::aux
0138 ::make_deduced_list<parameter_spec>::type deduced_list;
0139
0140
0141
0142
0143
0144 template <typename ArgumentPackAndError>
0145 struct match_base
0146 #if !defined(BOOST_PARAMETER_CAN_USE_MP11)
0147 : ::boost::mpl::if_<
0148 typename ::boost::parameter::aux::match_parameters_base_cond<
0149 ArgumentPackAndError
0150 , parameter_spec
0151 >::type
0152 , ::boost::mpl::identity<
0153 ::boost::parameter::parameters<Spec...>
0154 >
0155 , ::boost::parameter::void_
0156 >
0157 #endif
0158 {
0159 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0160 using type = ::boost::mp11::mp_if<
0161 typename ::boost::parameter::aux::match_parameters_base_cond<
0162 ArgumentPackAndError
0163 , parameter_spec
0164 >::type
0165 , ::boost::mp11::mp_identity<
0166 ::boost::parameter::parameters<Spec...>
0167 >
0168 , ::boost::parameter::void_
0169 >;
0170 #endif
0171 };
0172
0173
0174
0175 template <typename ...Args>
0176 struct match
0177 : ::boost::parameter::parameters<Spec...>
0178 ::BOOST_NESTED_TEMPLATE match_base<
0179 typename ::boost::parameter::aux::make_arg_list<
0180 typename ::boost::parameter::aux
0181 ::make_parameter_spec_items<parameter_spec,Args...>::type
0182 , deduced_list
0183 , ::boost::parameter::aux::tag_keyword_arg
0184
0185 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0186 , ::boost::mp11::mp_false
0187 #else
0188 , ::boost::mpl::false_
0189 #endif
0190 >::type
0191 >::type
0192 {
0193 };
0194
0195
0196 template <typename ...Args>
0197 struct bind
0198 #if !defined(BOOST_PARAMETER_CAN_USE_MP11)
0199 : ::boost::mpl::first<
0200 typename ::boost::parameter::aux::make_arg_list<
0201 typename ::boost::parameter::aux
0202 ::make_parameter_spec_items<parameter_spec,Args...>::type
0203 , deduced_list
0204 , ::boost::parameter::aux::tag_template_keyword_arg
0205 >::type
0206 >
0207 #endif
0208 {
0209 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0210 using type = ::boost::mp11::mp_at_c<
0211 typename ::boost::parameter::aux::make_arg_list<
0212 typename ::boost::parameter::aux
0213 ::make_parameter_spec_items<parameter_spec,Args...>::type
0214 , deduced_list
0215 , ::boost::parameter::aux::tag_template_keyword_arg
0216 >::type
0217 , 0
0218 >;
0219 #endif
0220 };
0221
0222
0223
0224
0225 inline ::boost::parameter::aux::empty_arg_list operator()() const
0226 {
0227 return ::boost::parameter::aux::empty_arg_list();
0228 }
0229
0230 template <typename A0, typename ...Args>
0231 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0232 inline ::boost::mp11::mp_at_c<
0233 #else
0234 inline typename ::boost::mpl::first<
0235 #endif
0236 typename ::boost::parameter::aux::make_arg_list<
0237 typename ::boost::parameter::aux
0238 ::make_parameter_spec_items<parameter_spec,A0,Args...>::type
0239 , deduced_list
0240 , ::boost::parameter::aux::tag_keyword_arg
0241 >::type
0242 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0243 , 0
0244 >
0245 #else
0246 >::type
0247 #endif
0248 operator()(A0&& a0, Args&& ...args) const
0249 {
0250 typedef typename ::boost::parameter::aux::make_arg_list<
0251 typename ::boost::parameter::aux
0252 ::make_parameter_spec_items<parameter_spec,A0,Args...>::type
0253 , deduced_list
0254 , ::boost::parameter::aux::tag_keyword_arg
0255 >::type list_error_pair;
0256
0257 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0258 using result_type = ::boost::mp11::mp_at_c<list_error_pair,0>;
0259
0260 using error = ::boost::mp11::mp_at_c<list_error_pair,1>;
0261 #else
0262 typedef typename ::boost::mpl
0263 ::first<list_error_pair>::type result_type;
0264
0265 typedef typename ::boost::mpl
0266 ::second<list_error_pair>::type error;
0267 #endif
0268
0269 error();
0270
0271 return ::boost::parameter::aux
0272 ::arg_list_factory<result_type,A0,Args...>::reverse(
0273 ::std::forward<A0>(a0)
0274 , ::std::forward<Args>(args)...
0275 );
0276 }
0277 };
0278 }}
0279
0280 #else
0281
0282 #include <boost/parameter/aux_/void.hpp>
0283 #include <boost/parameter/aux_/arg_list.hpp>
0284 #include <boost/parameter/aux_/pack/make_arg_list.hpp>
0285 #include <boost/parameter/aux_/pack/make_items.hpp>
0286 #include <boost/parameter/aux_/pack/make_deduced_items.hpp>
0287 #include <boost/parameter/aux_/pack/tag_template_keyword_arg.hpp>
0288 #include <boost/parameter/aux_/preprocessor/binary_seq_for_each.hpp>
0289 #include <boost/preprocessor/arithmetic/inc.hpp>
0290 #include <boost/preprocessor/repetition/enum_shifted.hpp>
0291 #include <boost/preprocessor/repetition/repeat.hpp>
0292 #include <boost/preprocessor/selection/min.hpp>
0293
0294 #if ( \
0295 BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY < \
0296 BOOST_PARAMETER_MAX_ARITY \
0297 )
0298 #include <boost/parameter/aux_/pack/tag_keyword_arg_ref.hpp>
0299 #include <boost/mpl/pair.hpp>
0300 #include <boost/preprocessor/arithmetic/dec.hpp>
0301 #include <boost/preprocessor/arithmetic/sub.hpp>
0302 #include <boost/preprocessor/facilities/intercept.hpp>
0303 #include <boost/preprocessor/iteration/iterate.hpp>
0304 #include <boost/preprocessor/repetition/enum.hpp>
0305 #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
0306 #endif
0307
0308 #if !defined(BOOST_NO_SFINAE) && \
0309 !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x592))
0310 #include <boost/parameter/aux_/pack/tag_keyword_arg.hpp>
0311 #include <boost/mpl/bool.hpp>
0312 #include <boost/mpl/if.hpp>
0313 #include <boost/mpl/identity.hpp>
0314 #include <boost/type_traits/is_same.hpp>
0315 #endif
0316
0317 #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
0318 #include <boost/preprocessor/repetition/enum_params.hpp>
0319 #else
0320 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
0321 #endif
0322
0323 #include <boost/parameter/aux_/preprocessor/no_perfect_forwarding_begin.hpp>
0324
0325 namespace boost { namespace parameter {
0326
0327 template <
0328 typename PS0
0329 , BOOST_PP_ENUM_SHIFTED(
0330 BOOST_PARAMETER_MAX_ARITY
0331 , BOOST_PARAMETER_template_args
0332 , PS
0333 )
0334 >
0335 struct parameters
0336 {
0337 typedef typename BOOST_PARAMETER_build_deduced_list(
0338 BOOST_PARAMETER_MAX_ARITY
0339 , ::boost::parameter::aux::make_deduced_items
0340 , PS
0341 )::type deduced_list;
0342
0343
0344
0345
0346
0347 #if !defined(BOOST_NO_SFINAE) && \
0348 !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x592))
0349
0350
0351 template <typename ArgumentPackAndError>
0352 struct match_base
0353 : ::boost::mpl::if_<
0354
0355
0356
0357
0358
0359
0360 typename BOOST_PP_REPEAT(
0361 BOOST_PARAMETER_MAX_ARITY
0362 , BOOST_PARAMETER_satisfies_begin
0363 , PS
0364 )
0365 ::boost::is_same<
0366 typename ::boost::mpl
0367 ::second<ArgumentPackAndError>::type
0368 , ::boost::parameter::void_
0369 >
0370 BOOST_PP_REPEAT(
0371 BOOST_PARAMETER_MAX_ARITY
0372 , BOOST_PARAMETER_satisfies_end
0373 , ::boost::mpl::false_
0374 )::type
0375 , ::boost::mpl::identity<
0376 ::boost::parameter::parameters<
0377 BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, PS)
0378 >
0379 >
0380 , ::boost::parameter::void_
0381 >
0382 {
0383 };
0384 #endif
0385
0386
0387
0388 template <
0389 #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
0390
0391
0392
0393 BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, typename A)
0394 #else
0395 BOOST_PP_ENUM_BINARY_PARAMS(
0396 BOOST_PARAMETER_MAX_ARITY
0397 , typename A
0398 , = ::boost::parameter::void_ BOOST_PP_INTERCEPT
0399 )
0400 #endif
0401 >
0402 struct match
0403 #if !defined(BOOST_NO_SFINAE) && \
0404 !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x592))
0405 : ::boost::parameter::parameters<
0406 BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, PS)
0407 >::BOOST_NESTED_TEMPLATE match_base<
0408 typename ::boost::parameter::aux::make_arg_list<
0409 typename BOOST_PARAMETER_build_arg_list(
0410 BOOST_PARAMETER_MAX_ARITY
0411 , ::boost::parameter::aux::make_items
0412 , PS
0413 , A
0414 )::type
0415 , deduced_list
0416 , ::boost::parameter::aux::tag_keyword_arg
0417
0418 , ::boost::mpl::false_
0419 >::type
0420 >::type
0421 {
0422 };
0423 #else
0424 {
0425 typedef ::boost::parameter::parameters<
0426 BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, PS)
0427 > type;
0428 };
0429 #endif
0430
0431
0432
0433
0434
0435
0436 template <
0437 #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
0438
0439
0440
0441 BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, typename A)
0442 #else
0443 BOOST_PP_ENUM_BINARY_PARAMS(
0444 BOOST_PARAMETER_MAX_ARITY
0445 , typename A
0446 , = ::boost::parameter::void_ BOOST_PP_INTERCEPT
0447 )
0448 #endif
0449 >
0450 struct bind
0451 {
0452 typedef typename ::boost::parameter::aux::make_arg_list<
0453 typename BOOST_PARAMETER_build_arg_list(
0454 BOOST_PARAMETER_MAX_ARITY
0455 , ::boost::parameter::aux::make_items
0456 , PS
0457 , A
0458 )::type
0459 , deduced_list
0460 , ::boost::parameter::aux::tag_template_keyword_arg
0461 >::type result;
0462
0463 typedef typename ::boost::mpl::first<result>::type type;
0464 };
0465
0466 BOOST_PP_REPEAT(
0467 BOOST_PARAMETER_MAX_ARITY
0468 , BOOST_PARAMETER_forward_typedef
0469 , (PS)(parameter_spec)
0470 )
0471
0472
0473
0474
0475
0476
0477
0478
0479
0480 inline ::boost::parameter::aux::empty_arg_list operator()() const
0481 {
0482 return ::boost::parameter::aux::empty_arg_list();
0483 }
0484
0485 #if (0 < BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY)
0486 BOOST_PP_REPEAT(
0487 BOOST_PP_MIN(
0488 BOOST_PP_INC(BOOST_PARAMETER_MAX_ARITY)
0489 , BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY
0490 )
0491 , BOOST_PARAMETER_AUX_PP_BINARY_SEQ_FOR_EACH_Z
0492 , (BOOST_PARAMETER_function_call_op_overload_R)(_)
0493 )
0494 #if ( \
0495 BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY < \
0496 BOOST_PARAMETER_MAX_ARITY \
0497 )
0498 #define BOOST_PP_ITERATION_PARAMS_1 \
0499 (3,( \
0500 BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY \
0501 , BOOST_PARAMETER_MAX_ARITY \
0502 , <boost/parameter/aux_/preprocessor/overloads.hpp> \
0503 ))
0504 #include BOOST_PP_ITERATE()
0505 #endif
0506 #else
0507 template <typename A0>
0508 inline typename ::boost::mpl::first<
0509 typename ::boost::parameter::aux::make_arg_list<
0510 ::boost::parameter::aux::item<
0511 PS0,A0
0512 >
0513 , deduced_list
0514 , ::boost::parameter::aux::tag_keyword_arg_ref
0515 >::type
0516 >::type
0517 operator()(A0& a0) const
0518 {
0519 typedef typename ::boost::parameter::aux::make_arg_list<
0520 ::boost::parameter::aux::item<
0521 PS0,A0
0522 >
0523 , deduced_list
0524 , ::boost::parameter::aux::tag_keyword_arg_ref
0525 >::type result;
0526
0527 typedef typename ::boost::mpl::first<result>::type result_type;
0528 typedef typename ::boost::mpl::second<result>::type error;
0529 error();
0530
0531 return result_type(
0532 a0
0533
0534 BOOST_PP_ENUM_TRAILING_PARAMS(
0535 BOOST_PP_SUB(BOOST_PARAMETER_COMPOSE_MAX_ARITY, 1)
0536 , ::boost::parameter::aux::void_reference() BOOST_PP_INTERCEPT
0537 )
0538 );
0539 }
0540
0541 template <typename A0, typename A1>
0542 inline typename ::boost::mpl::first<
0543 typename ::boost::parameter::aux::make_arg_list<
0544 ::boost::parameter::aux::item<
0545 PS0,A0
0546 , ::boost::parameter::aux::item<
0547 PS1,A1
0548 >
0549 >
0550 , deduced_list
0551 , ::boost::parameter::aux::tag_keyword_arg_ref
0552 >::type
0553 >::type
0554 operator()(A0& a0, A1& a1) const
0555 {
0556 typedef typename ::boost::parameter::aux::make_arg_list<
0557 ::boost::parameter::aux::item<
0558 PS0,A0
0559 , ::boost::parameter::aux::item<
0560 PS1,A1
0561 >
0562 >
0563 , deduced_list
0564 , ::boost::parameter::aux::tag_keyword_arg
0565 >::type result;
0566
0567 typedef typename ::boost::mpl::first<result>::type result_type;
0568 typedef typename ::boost::mpl::second<result>::type error;
0569 error();
0570
0571 return result_type(
0572 a1
0573 , a0
0574
0575 BOOST_PP_ENUM_TRAILING_PARAMS(
0576 BOOST_PP_SUB(BOOST_PARAMETER_COMPOSE_MAX_ARITY, 2)
0577 , ::boost::parameter::aux::void_reference() BOOST_PP_INTERCEPT
0578 )
0579 );
0580 }
0581
0582 #if (2 < BOOST_PARAMETER_MAX_ARITY)
0583
0584 #define BOOST_PP_ITERATION_PARAMS_1 \
0585 (3,( \
0586 3 \
0587 , BOOST_PARAMETER_MAX_ARITY \
0588 , <boost/parameter/aux_/preprocessor/overloads.hpp> \
0589 ))
0590 #include BOOST_PP_ITERATE()
0591 #endif
0592 #endif
0593 };
0594 }}
0595
0596 #include <boost/parameter/aux_/preprocessor/no_perfect_forwarding_end.hpp>
0597
0598 #endif
0599 #endif
0600