1 // Copyright David Abrahams, Daniel Wallin 2003. 2 // Copyright Cromwell D. Enage 2017. 3 // Distributed under the Boost Software License, Version 1.0. 4 // (See accompanying file LICENSE_1_0.txt or copy at 5 // http://www.boost.org/LICENSE_1_0.txt) 6 7 // No include guard. This file is intended for multiple inclusion. 8 9 #define BOOST_PARAMETER_right_angle(z, n, _) > 10 /**/ 11 12 #define BOOST_PARAMETER_satisfies_end(z, n, false_t) ,false_t> 13 /**/ 14 15 #include <boost/preprocessor/seq/elem.hpp> 16 #include <boost/preprocessor/cat.hpp> 17 18 // Generates: 19 // 20 // make< 21 // parameter_spec##0, argument_type##0 22 // , make< 23 // parameter_spec##1, argument_type##1 24 // , ... boost::mpl::identity<boost::parameter::aux::empty_arg_list> 25 // ...> 26 // > 27 #define BOOST_PARAMETER_make_arg_list(z, n, names) \ 28 BOOST_PP_SEQ_ELEM(0, names)< \ 29 BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, names), n), \ 30 BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(2, names), n), 31 /**/ 32 33 #include <boost/parameter/aux_/void.hpp> 34 #include <boost/mpl/identity.hpp> 35 #include <boost/preprocessor/repetition/repeat.hpp> 36 37 #define BOOST_PARAMETER_build_arg_list(n, make, param_spec, arg_type) \ 38 BOOST_PP_REPEAT( \ 39 n, BOOST_PARAMETER_make_arg_list, (make)(param_spec)(arg_type) \ 40 ) \ 41 ::boost::mpl::identity< ::boost::parameter::void_> \ 42 BOOST_PP_REPEAT(n, BOOST_PARAMETER_right_angle, _) 43 /**/ 44 45 #define BOOST_PARAMETER_make_deduced_list(z, n, names) \ 46 BOOST_PP_SEQ_ELEM(0, names)<BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, names), n), 47 /**/ 48 49 #define BOOST_PARAMETER_build_deduced_list(n, make, parameter_spec) \ 50 BOOST_PP_REPEAT( \ 51 n, BOOST_PARAMETER_make_deduced_list, (make)(parameter_spec) \ 52 ) \ 53 ::boost::mpl::identity< ::boost::parameter::void_> \ 54 BOOST_PP_REPEAT(n, BOOST_PARAMETER_right_angle, _) 55 /**/ 56 57 #define BOOST_PARAMETER_forward_typedef(z, n, names) \ 58 typedef BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, names), n) \ 59 BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, names), n); 60 /**/ 61 62 #define BOOST_PARAMETER_template_args(z, n, prefix) \ 63 typename BOOST_PP_CAT(prefix, n) = ::boost::parameter::void_ 64 /**/ 65 66 #include <boost/mpl/pair.hpp> 67 68 #if (0 < BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY) 69 70 #include <boost/parameter/aux_/pack/item.hpp> 71 #include <boost/preprocessor/control/iif.hpp> 72 73 #define BOOST_PARAMETER_make_arg_items_R(r, prefix, i, elem) \ 74 ::boost::parameter::aux::item<BOOST_PP_CAT(prefix, i), \ 75 BOOST_PP_CAT(A, i) BOOST_PP_IIF(elem, &, const&), 76 /**/ 77 78 #include <boost/parameter/aux_/pack/make_arg_list.hpp> 79 #include <boost/parameter/aux_/pack/tag_keyword_arg.hpp> 80 #include <boost/preprocessor/seq/for_each_i.hpp> 81 #include <boost/preprocessor/seq/size.hpp> 82 83 #define BOOST_PARAMETER_function_call_arg_list_R(r, seq) \ 84 ::boost::parameter::aux::make_arg_list< \ 85 BOOST_PP_SEQ_FOR_EACH_I_R( \ 86 r, BOOST_PARAMETER_make_arg_items_R, PS, seq \ 87 ) \ 88 ::boost::parameter::void_ \ 89 BOOST_PP_REPEAT( \ 90 BOOST_PP_SEQ_SIZE(seq), BOOST_PARAMETER_right_angle, _ \ 91 ) \ 92 , deduced_list \ 93 , ::boost::parameter::aux::tag_keyword_arg \ 94 > 95 /**/ 96 97 #include <boost/preprocessor/arithmetic/sub.hpp> 98 99 #define BOOST_PARAMETER_function_call_arg_pack_init(z, n, limit) \ 100 BOOST_PP_CAT(a, BOOST_PP_SUB(limit, n)) 101 /**/ 102 103 #include <boost/parameter/aux_/preprocessor/binary_seq_to_args.hpp> 104 #include <boost/preprocessor/arithmetic/dec.hpp> 105 #include <boost/preprocessor/facilities/intercept.hpp> 106 #include <boost/preprocessor/repetition/enum.hpp> 107 #include <boost/preprocessor/repetition/enum_params.hpp> 108 #include <boost/preprocessor/repetition/enum_binary_params.hpp> 109 #include <boost/preprocessor/repetition/enum_trailing_params.hpp> 110 #include <boost/preprocessor/seq/seq.hpp> 111 112 #define BOOST_PARAMETER_function_call_op_overload_R(r, seq) \ 113 template < \ 114 BOOST_PP_ENUM_PARAMS( \ 115 BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)) \ 116 , typename A \ 117 ) \ 118 > \ 119 inline typename ::boost::mpl::first< \ 120 typename BOOST_PARAMETER_function_call_arg_list_R( \ 121 r, BOOST_PP_SEQ_TAIL(seq) \ 122 )::type \ 123 >::type \ 124 operator()( \ 125 BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS( \ 126 BOOST_PP_SEQ_TAIL(seq), (A)(a) \ 127 ) \ 128 ) const \ 129 { \ 130 typedef typename BOOST_PARAMETER_function_call_arg_list_R( \ 131 r, BOOST_PP_SEQ_TAIL(seq) \ 132 )::type result; \ 133 typedef typename ::boost::mpl::first<result>::type result_type; \ 134 typedef typename ::boost::mpl::second<result>::type error; \ 135 error(); \ 136 return result_type( \ 137 BOOST_PP_ENUM( \ 138 BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)) \ 139 , BOOST_PARAMETER_function_call_arg_pack_init \ 140 , BOOST_PP_DEC(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq))) \ 141 ) \ 142 BOOST_PP_ENUM_TRAILING_PARAMS( \ 143 BOOST_PP_SUB( \ 144 BOOST_PARAMETER_COMPOSE_MAX_ARITY \ 145 , BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)) \ 146 ) \ 147 , ::boost::parameter::aux::void_reference() BOOST_PP_INTERCEPT \ 148 ) \ 149 ); \ 150 } 151 /**/ 152 153 #endif // exponential overloads 154 155 #include <boost/parameter/aux_/pack/satisfies.hpp> 156 #include <boost/mpl/eval_if.hpp> 157 158 #define BOOST_PARAMETER_satisfies_begin(z, n, prefix) \ 159 ::boost::mpl::eval_if< \ 160 ::boost::parameter::aux::satisfies_requirements_of< \ 161 typename ::boost::mpl::first<ArgumentPackAndError>::type \ 162 , BOOST_PP_CAT(prefix, n) \ 163 >, 164 /**/ 165 166