Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:49:55

0001 // Copyright Daniel Wallin 2006.
0002 // Copyright Cromwell D. Enage 2017.
0003 // Distributed under the Boost Software License, Version 1.0.
0004 // (See accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 #ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FORWARDING_OVERLOADS_HPP
0008 #define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FORWARDING_OVERLOADS_HPP
0009 
0010 #include <boost/parameter/config.hpp>
0011 
0012 #if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
0013 
0014 #include <boost/preprocessor/cat.hpp>
0015 
0016 // Expands to a forwarding parameter for a constructor or forwarding function.
0017 #define BOOST_PARAMETER_FUNCTION_ARG_TYPE_Z(z, n, type_prefix)               \
0018     BOOST_PP_CAT(type_prefix, n)&&
0019 /**/
0020 
0021 #include <utility>
0022 
0023 // Expands to an argument passed from a forwarding function to the front-end
0024 // implementation function, or from a constructor to its delegate.
0025 #define BOOST_PARAMETER_FUNCTION_FORWARD_PARAM_Z(z, n, type_prefix)          \
0026     ::std::forward<BOOST_PP_CAT(type_prefix, n)>(BOOST_PP_CAT(a, n))
0027 /**/
0028 
0029 #include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
0030 #include <boost/preprocessor/tuple/elem.hpp>
0031 
0032 // Expands to the default constructor, whose job is to pass an empty back to
0033 // the delegate constructor of the base class.
0034 #define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_0_Z(z, n, data)                 \
0035     inline BOOST_PP_TUPLE_ELEM(2, 0, data)()                                 \
0036       : BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(2, 1, data))( \
0037             BOOST_PP_CAT(constructor_parameters, __LINE__)()()               \
0038         )                                                                    \
0039     {                                                                        \
0040     }
0041 /**/
0042 
0043 #include <boost/parameter/aux_/pp_impl/argument_pack.hpp>
0044 #include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
0045 #include <boost/preprocessor/control/expr_if.hpp>
0046 
0047 // Expands to a 0-arity forwarding function, whose job is to pass an empty
0048 // pack to the front-end implementation function.
0049 #define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_0_Z(z, n, data)            \
0050     BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4, 1, data))  \
0051     inline BOOST_PARAMETER_FUNCTION_RESULT_NAME(                             \
0052         BOOST_PP_TUPLE_ELEM(4, 1, data)                                      \
0053       , BOOST_PP_TUPLE_ELEM(4, 3, data)                                      \
0054     )<                                                                       \
0055         ::boost::parameter::aux::argument_pack<                              \
0056             BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(                     \
0057                 BOOST_PP_TUPLE_ELEM(4, 1, data)                              \
0058               , BOOST_PP_TUPLE_ELEM(4, 3, data)                              \
0059             )                                                                \
0060         >::type                                                              \
0061     >::type                                                                  \
0062     BOOST_PARAMETER_MEMBER_FUNCTION_NAME(BOOST_PP_TUPLE_ELEM(3, 0, data))()  \
0063     BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 3, data), const)                 \
0064     {                                                                        \
0065         return BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 2, data), this->)     \
0066         BOOST_PARAMETER_FUNCTION_IMPL_NAME(                                  \
0067             BOOST_PP_TUPLE_ELEM(4, 1, data)                                  \
0068           , BOOST_PP_TUPLE_ELEM(4, 3, data)                                  \
0069         )(                                                                   \
0070             BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(                     \
0071                 BOOST_PP_TUPLE_ELEM(4, 1, data)                              \
0072               , BOOST_PP_TUPLE_ELEM(4, 3, data)                              \
0073             )()()                                                            \
0074         );                                                                   \
0075     }
0076 /**/
0077 
0078 #include <boost/parameter/aux_/preprocessor/impl/function_forward_match.hpp>
0079 #include <boost/preprocessor/repetition/enum.hpp>
0080 #include <boost/preprocessor/repetition/enum_params.hpp>
0081 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
0082 
0083 // Expands to a forwarding function, whose job is to consolidate its arguments
0084 // into a pack for the front-end implementation function to take in.
0085 #define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_1_Z(z, n, data)            \
0086     template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename ParameterArgumentType)>  \
0087     BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4, 1, data))  \
0088     inline typename BOOST_PARAMETER_FUNCTION_RESULT_NAME(                    \
0089         BOOST_PP_TUPLE_ELEM(4, 1, data)                                      \
0090       , BOOST_PP_TUPLE_ELEM(4, 3, data)                                      \
0091     )<                                                                       \
0092         typename ::boost::parameter::aux::argument_pack<                     \
0093             BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(                     \
0094                 BOOST_PP_TUPLE_ELEM(4, 1, data)                              \
0095               , BOOST_PP_TUPLE_ELEM(4, 3, data)                              \
0096             )                                                                \
0097           , BOOST_PP_CAT(BOOST_PP_ENUM_, z)(                                 \
0098                 n                                                            \
0099               , BOOST_PARAMETER_FUNCTION_ARG_TYPE_Z                          \
0100               , ParameterArgumentType                                        \
0101             )                                                                \
0102         >::type                                                              \
0103     >::type                                                                  \
0104     BOOST_PARAMETER_MEMBER_FUNCTION_NAME(BOOST_PP_TUPLE_ELEM(4, 0, data))(   \
0105         BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, ParameterArgumentType, && a)     \
0106         BOOST_PARAMETER_FUNCTION_FORWARD_MATCH_Z(                            \
0107             z                                                                \
0108           , BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(                     \
0109                 BOOST_PP_TUPLE_ELEM(4, 1, data)                              \
0110               , BOOST_PP_TUPLE_ELEM(4, 3, data)                              \
0111             )                                                                \
0112           , n                                                                \
0113           , ParameterArgumentType                                            \
0114         )                                                                    \
0115     ) BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 3, data), const)               \
0116     {                                                                        \
0117         return BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 2, data), this->)     \
0118         BOOST_PARAMETER_FUNCTION_IMPL_NAME(                                  \
0119             BOOST_PP_TUPLE_ELEM(4, 1, data)                                  \
0120           , BOOST_PP_TUPLE_ELEM(4, 3, data)                                  \
0121         )(                                                                   \
0122             BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(                     \
0123                 BOOST_PP_TUPLE_ELEM(4, 1, data)                              \
0124               , BOOST_PP_TUPLE_ELEM(4, 3, data)                              \
0125             )()(                                                             \
0126                 BOOST_PP_CAT(BOOST_PP_ENUM_, z)(                             \
0127                     n                                                        \
0128                   , BOOST_PARAMETER_FUNCTION_FORWARD_PARAM_Z                 \
0129                   , ParameterArgumentType                                    \
0130                 )                                                            \
0131             )                                                                \
0132         );                                                                   \
0133     }
0134 /**/
0135 
0136 #include <boost/preprocessor/comparison/equal.hpp>
0137 
0138 // Expands to a constructor whose job is to consolidate its arguments into a
0139 // pack for the delegate constructor of the base class to take in.
0140 #define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_1_Z(z, n, data)                 \
0141     template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename ParameterArgumentType)>  \
0142     BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit)                         \
0143     inline BOOST_PP_TUPLE_ELEM(2, 0, data)(                                  \
0144         BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, ParameterArgumentType, && a)     \
0145         BOOST_PARAMETER_FUNCTION_FORWARD_MATCH_Z(                            \
0146             z                                                                \
0147           , BOOST_PP_CAT(constructor_parameters, __LINE__)                   \
0148           , n                                                                \
0149           , ParameterArgumentType                                            \
0150         )                                                                    \
0151     ) : BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(2, 1, data))( \
0152             BOOST_PP_CAT(constructor_parameters, __LINE__)()(                \
0153                 BOOST_PP_CAT(BOOST_PP_ENUM_, z)(                             \
0154                     n                                                        \
0155                   , BOOST_PARAMETER_FUNCTION_FORWARD_PARAM_Z                 \
0156                   , ParameterArgumentType                                    \
0157                 )                                                            \
0158             )                                                                \
0159         )                                                                    \
0160     {                                                                        \
0161     }
0162 /**/
0163 
0164 #include <boost/preprocessor/control/if.hpp>
0165 
0166 #define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z(z, n, data)              \
0167     BOOST_PP_IF(                                                             \
0168         n                                                                    \
0169       , BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_1_Z                        \
0170       , BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_0_Z                        \
0171     )(z, n, data)
0172 /**/
0173 
0174 #define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z(z, n, data)                   \
0175     BOOST_PP_IF(                                                             \
0176         n                                                                    \
0177       , BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_1_Z                             \
0178       , BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_0_Z                             \
0179     )(z, n, data)
0180 /**/
0181 
0182 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
0183 
0184 // Helper macro for BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS.
0185 #define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX(nm, impl, r, is_m, c) \
0186     BOOST_PP_REPEAT_FROM_TO(                                                 \
0187         BOOST_PP_TUPLE_ELEM(2, 0, r)                                         \
0188       , BOOST_PP_TUPLE_ELEM(2, 1, r)                                         \
0189       , BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z                          \
0190       , (                                                                    \
0191             nm                                                               \
0192           , impl                                                             \
0193           , BOOST_PP_IF(                                                     \
0194                 BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(nm)                \
0195               , 0                                                            \
0196               , is_m                                                         \
0197             )                                                                \
0198           , c                                                                \
0199         )                                                                    \
0200     )
0201 /**/
0202 
0203 // Helper macro for BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS.
0204 #define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX(class_, base, range)       \
0205     BOOST_PP_REPEAT_FROM_TO(                                                 \
0206         BOOST_PP_TUPLE_ELEM(2, 0, range)                                     \
0207       , BOOST_PP_TUPLE_ELEM(2, 1, range)                                     \
0208       , BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z                               \
0209       , (class_, base)                                                       \
0210     )
0211 /**/
0212 
0213 #include <boost/parameter/aux_/preprocessor/impl/arity_range.hpp>
0214 
0215 // Expands to the layer of forwarding functions for the function with the
0216 // specified name, whose arguments determine the range of arities.
0217 #define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS(name, impl, a, is_m, c)   \
0218     BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX(                          \
0219         name, impl, BOOST_PARAMETER_ARITY_RANGE(a), is_m, c                  \
0220     )
0221 /**/
0222 
0223 // Expands to the layer of forwarding functions for the constructor in the
0224 // specified class, whose arguments determine the range of arities.
0225 #define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS(class_, base, args)            \
0226     BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX(                               \
0227         class_, base, BOOST_PARAMETER_ARITY_RANGE(args)                      \
0228     )
0229 /**/
0230 
0231 #else   // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
0232 
0233 #include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
0234 #include <boost/preprocessor/seq/seq.hpp>
0235 #include <boost/preprocessor/tuple/elem.hpp>
0236 #include <boost/preprocessor/cat.hpp>
0237 
0238 // Expands to the default constructor, whose job is to pass an empty argument
0239 // pack back to the delegate constructor of the base class.
0240 #define BOOST_PARAMETER_DEFAULT_CONSTRUCTOR(z, n, seq)                       \
0241     inline                                                                   \
0242     BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)))()   \
0243       : BOOST_PARAMETER_PARENTHESIZED_TYPE(                                  \
0244             BOOST_PP_TUPLE_ELEM(                                             \
0245                 2, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq))              \
0246             )                                                                \
0247         )(BOOST_PP_CAT(constructor_parameters, __LINE__)()())                \
0248     {                                                                        \
0249     }
0250 /**/
0251 
0252 #include <boost/parameter/aux_/pp_impl/argument_pack.hpp>
0253 #include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
0254 #include <boost/preprocessor/control/expr_if.hpp>
0255 
0256 // Expands to a 0-arity forwarding function, whose job is to pass an empty
0257 // argument pack to the front-end implementation function.
0258 #define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_0_ARITY(z, n, seq)         \
0259     BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(                                  \
0260         BOOST_PP_TUPLE_ELEM(                                                 \
0261             4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq))                  \
0262         )                                                                    \
0263     )                                                                        \
0264     inline BOOST_PARAMETER_FUNCTION_RESULT_NAME(                             \
0265         BOOST_PP_TUPLE_ELEM(                                                 \
0266             4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq))                  \
0267         )                                                                    \
0268       , BOOST_PP_TUPLE_ELEM(                                                 \
0269             4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq))                  \
0270         )                                                                    \
0271     )<                                                                       \
0272         ::boost::parameter::aux::argument_pack<                              \
0273             BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(                     \
0274                 BOOST_PP_TUPLE_ELEM(                                         \
0275                     4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq))          \
0276                 )                                                            \
0277               , BOOST_PP_TUPLE_ELEM(                                         \
0278                     4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq))          \
0279                 )                                                            \
0280             )                                                                \
0281         >::type                                                              \
0282     >::type                                                                  \
0283     BOOST_PARAMETER_MEMBER_FUNCTION_NAME(                                    \
0284         BOOST_PP_TUPLE_ELEM(                                                 \
0285             4, 0, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq))                  \
0286         )                                                                    \
0287     )() BOOST_PP_EXPR_IF(                                                    \
0288         BOOST_PP_TUPLE_ELEM(                                                 \
0289             4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq))                  \
0290         )                                                                    \
0291       , const                                                                \
0292     )                                                                        \
0293     {                                                                        \
0294         return BOOST_PP_EXPR_IF(                                             \
0295             BOOST_PP_TUPLE_ELEM(                                             \
0296                 4, 2, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq))              \
0297             )                                                                \
0298           , this->                                                           \
0299         ) BOOST_PARAMETER_FUNCTION_IMPL_NAME(                                \
0300             BOOST_PP_TUPLE_ELEM(                                             \
0301                 4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq))              \
0302             )                                                                \
0303           , BOOST_PP_TUPLE_ELEM(                                             \
0304                 4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq))              \
0305             )                                                                \
0306         )(                                                                   \
0307             BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(                     \
0308                 BOOST_PP_TUPLE_ELEM(                                         \
0309                     4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq))          \
0310                 )                                                            \
0311               , BOOST_PP_TUPLE_ELEM(                                         \
0312                     4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq))          \
0313                 )                                                            \
0314             )()()                                                            \
0315         );                                                                   \
0316     }
0317 /**/
0318 
0319 #include <boost/parameter/aux_/preprocessor/binary_seq_to_args.hpp>
0320 #include <boost/parameter/aux_/preprocessor/impl/function_forward_match.hpp>
0321 #include <boost/preprocessor/comparison/equal.hpp>
0322 #include <boost/preprocessor/repetition/enum_params.hpp>
0323 #include <boost/preprocessor/seq/size.hpp>
0324 
0325 // Expands to a constructor whose job is to consolidate its arguments into a
0326 // pack for the delegate constructor of the base class to take in.  Each
0327 // element in BOOST_PP_SEQ_TAIL(seq) determines the const-ness of the
0328 // corresponding argument.
0329 #define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_R(r, seq)                       \
0330     template <                                                               \
0331         BOOST_PP_ENUM_PARAMS(                                                \
0332             BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq))                        \
0333           , typename ParameterArgumentType                                   \
0334         )                                                                    \
0335     >                                                                        \
0336     BOOST_PP_EXPR_IF(                                                        \
0337         BOOST_PP_EQUAL(BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)), 1)         \
0338       , explicit                                                             \
0339     )                                                                        \
0340     inline BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_SEQ_HEAD(seq))(                \
0341         BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS(                           \
0342             BOOST_PP_SEQ_TAIL(seq), (ParameterArgumentType)(a)               \
0343         )                                                                    \
0344         BOOST_PARAMETER_FUNCTION_FORWARD_MATCH(                              \
0345             BOOST_PP_CAT(constructor_parameters, __LINE__)                   \
0346           , BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq))                        \
0347           , ParameterArgumentType                                            \
0348         )                                                                    \
0349     ) : BOOST_PARAMETER_PARENTHESIZED_TYPE(                                  \
0350             BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_HEAD(seq))                \
0351         )(                                                                   \
0352             BOOST_PP_CAT(constructor_parameters, __LINE__)()(                \
0353                 BOOST_PP_ENUM_PARAMS(                                        \
0354                     BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)), a             \
0355                 )                                                            \
0356             )                                                                \
0357         )                                                                    \
0358     {                                                                        \
0359     }
0360 /**/
0361 
0362 // Expands to a forwarding function, whose job is to consolidate its arguments
0363 // into a pack for the front-end implementation function to take in.  Each
0364 // element in BOOST_PP_SEQ_TAIL(seq) determines the const-ness of the
0365 // corresponding argument.
0366 #define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_R(r, seq)                  \
0367     template <                                                               \
0368         BOOST_PP_ENUM_PARAMS(                                                \
0369             BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq))                        \
0370           , typename ParameterArgumentType                                   \
0371         )                                                                    \
0372     >                                                                        \
0373     BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(                                  \
0374         BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq))                    \
0375     )                                                                        \
0376     inline typename BOOST_PARAMETER_FUNCTION_RESULT_NAME(                    \
0377         BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq))                    \
0378       , BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq))                    \
0379     )<                                                                       \
0380         typename ::boost::parameter::aux::argument_pack<                     \
0381             BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(                     \
0382                 BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq))            \
0383               , BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq))            \
0384             )                                                                \
0385           , BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS(                       \
0386                 BOOST_PP_SEQ_TAIL(seq), (ParameterArgumentType)              \
0387             )                                                                \
0388         >::type                                                              \
0389     >::type                                                                  \
0390     BOOST_PARAMETER_MEMBER_FUNCTION_NAME(                                    \
0391         BOOST_PP_TUPLE_ELEM(4, 0, BOOST_PP_SEQ_HEAD(seq))                    \
0392     )(                                                                       \
0393         BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS(                           \
0394             BOOST_PP_SEQ_TAIL(seq), (ParameterArgumentType)(a)               \
0395         )                                                                    \
0396         BOOST_PARAMETER_FUNCTION_FORWARD_MATCH(                              \
0397             BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(                     \
0398                 BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq))            \
0399               , BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq))            \
0400             )                                                                \
0401           , BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq))                        \
0402           , ParameterArgumentType                                            \
0403         )                                                                    \
0404     ) BOOST_PP_EXPR_IF(                                                      \
0405         BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)), const             \
0406     )                                                                        \
0407     {                                                                        \
0408         return BOOST_PP_EXPR_IF(                                             \
0409             BOOST_PP_TUPLE_ELEM(4, 2, BOOST_PP_SEQ_HEAD(seq))                \
0410           , this->                                                           \
0411         ) BOOST_PARAMETER_FUNCTION_IMPL_NAME(                                \
0412             BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq))                \
0413           , BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq))                \
0414         )(                                                                   \
0415             BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(                     \
0416                 BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq))            \
0417               , BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq))            \
0418             )()(                                                             \
0419                 BOOST_PP_ENUM_PARAMS(                                        \
0420                     BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)), a             \
0421                 )                                                            \
0422             )                                                                \
0423         );                                                                   \
0424     }
0425 /**/
0426 
0427 #include <boost/parameter/aux_/preprocessor/binary_seq_for_each.hpp>
0428 #include <boost/preprocessor/control/if.hpp>
0429 
0430 // Expands to all constructors that take in n arguments.  Enables
0431 // BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX to use
0432 // BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z within BOOST_PP_REPEAT_FROM_TO.
0433 #define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z(z, n, data)                   \
0434     BOOST_PP_IF(                                                             \
0435         n                                                                    \
0436       , BOOST_PARAMETER_AUX_PP_BINARY_SEQ_FOR_EACH_Z                         \
0437       , BOOST_PARAMETER_DEFAULT_CONSTRUCTOR                                  \
0438     )(z, n, (BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_R)(data))
0439 /**/
0440 
0441 // Expands to all forwarding functions that take in n arguments.  Enables
0442 // BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX to use
0443 // BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z within BOOST_PP_REPEAT_FROM_TO.
0444 #define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z(z, n, data)              \
0445     BOOST_PP_IF(                                                             \
0446         n                                                                    \
0447       , BOOST_PARAMETER_AUX_PP_BINARY_SEQ_FOR_EACH_Z                         \
0448       , BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_0_ARITY                    \
0449     )(z, n, (BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_R)(data))
0450 /**/
0451 
0452 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
0453 
0454 // Helper macro for BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS.
0455 #define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX(class_, base, range)       \
0456     BOOST_PP_REPEAT_FROM_TO(                                                 \
0457         BOOST_PP_TUPLE_ELEM(2, 0, range)                                     \
0458       , BOOST_PP_TUPLE_ELEM(2, 1, range)                                     \
0459       , BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z                               \
0460       , (class_, base)                                                       \
0461     )
0462 /**/
0463 
0464 // Helper macro for BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS.
0465 #define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX(nm, impl, r, is_m, c) \
0466     BOOST_PP_REPEAT_FROM_TO(                                                 \
0467         BOOST_PP_TUPLE_ELEM(2, 0, r)                                         \
0468       , BOOST_PP_TUPLE_ELEM(2, 1, r)                                         \
0469       , BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z                          \
0470       , (                                                                    \
0471             nm                                                               \
0472           , impl                                                             \
0473           , BOOST_PP_IF(                                                     \
0474                 BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(impl)              \
0475               , 0                                                            \
0476               , is_m                                                         \
0477             )                                                                \
0478           , c                                                                \
0479         )                                                                    \
0480     )
0481 /**/
0482 
0483 #include <boost/parameter/aux_/preprocessor/impl/arity_range.hpp>
0484 
0485 // Expands to the layer of forwarding functions for the constructor in the
0486 // specified class, whose arguments determine the range of arities.
0487 #define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS(class_, base, args)            \
0488     BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX(                               \
0489         class_                                                               \
0490       , base                                                                 \
0491       , BOOST_PARAMETER_ARITY_RANGE(args)                                    \
0492     )
0493 /**/
0494 
0495 // Expands to the layer of forwarding functions for the function with the
0496 // specified name, whose arguments determine the range of arities.
0497 #define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS(name, impl, a, is_m, c)   \
0498     BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX(                          \
0499         name                                                                 \
0500       , impl                                                                 \
0501       , BOOST_PARAMETER_ARITY_RANGE(a)                                       \
0502       , is_m                                                                 \
0503       , c                                                                    \
0504     )
0505 /**/
0506 
0507 #endif  // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
0508 #endif  // include guard
0509