update boost

This commit is contained in:
2023-11-24 12:56:13 -06:00
parent cfc99971af
commit 19d727037a
9260 changed files with 849256 additions and 299957 deletions

View File

@@ -0,0 +1,24 @@
// Copyright Daniel Wallin 2006.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_ARGUMENT_SPECS_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_ARGUMENT_SPECS_HPP
#include <boost/preprocessor/tuple/elem.hpp>
// Accessor macros for the argument specs tuple.
#define BOOST_PARAMETER_FN_ARG_QUALIFIER(x) BOOST_PP_TUPLE_ELEM(4, 0, x)
#define BOOST_PARAMETER_FN_ARG_KEYWORD(x) BOOST_PP_TUPLE_ELEM(4, 1, x)
#define BOOST_PARAMETER_FN_ARG_PRED(x) BOOST_PP_TUPLE_ELEM(4, 2, x)
#define BOOST_PARAMETER_FN_ARG_DEFAULT(x) BOOST_PP_TUPLE_ELEM(4, 3, x)
#include <boost/parameter/aux_/preprocessor/qualifier.hpp>
#define BOOST_PARAMETER_FN_ARG_NAME(x) \
BOOST_PARAMETER_UNQUALIFIED(BOOST_PARAMETER_FN_ARG_KEYWORD(x))
/**/
#endif // include guard

View File

@@ -0,0 +1,42 @@
// Copyright Daniel Wallin 2006.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_ARITY_RANGE_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_ARITY_RANGE_HPP
// Helper macros for BOOST_PARAMETER_ARITY_RANGE.
#define BOOST_PARAMETER_ARITY_RANGE_M_optional(state) state
#define BOOST_PARAMETER_ARITY_RANGE_M_deduced_optional(state) state
#include <boost/preprocessor/arithmetic/inc.hpp>
#define BOOST_PARAMETER_ARITY_RANGE_M_required(state) BOOST_PP_INC(state)
#define BOOST_PARAMETER_ARITY_RANGE_M_deduced_required(state) \
BOOST_PP_INC(state)
/**/
#include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp>
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_ARITY_RANGE_M(s, state, x) \
BOOST_PP_CAT( \
BOOST_PARAMETER_ARITY_RANGE_M_ \
, BOOST_PARAMETER_FN_ARG_QUALIFIER(x) \
)(state)
/**/
#include <boost/preprocessor/seq/fold_left.hpp>
#include <boost/preprocessor/seq/size.hpp>
// Calculates [begin, end) arity range.
#define BOOST_PARAMETER_ARITY_RANGE(args) \
( \
BOOST_PP_SEQ_FOLD_LEFT(BOOST_PARAMETER_ARITY_RANGE_M, 0, args) \
, BOOST_PP_INC(BOOST_PP_SEQ_SIZE(args)) \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,143 @@
// Copyright Daniel Wallin 2005.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FLATTEN_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FLATTEN_HPP
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT_required required,
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT_optional optional,
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT_deduced deduced,
#define BOOST_PARAMETER_AUX_PP_FLATTEN_IDENTITY(x) x
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC0_DUMMY_ELEM(z, n, data) ~
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT(sub) \
BOOST_PP_CAT(BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT_, sub)
/**/
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_AS_DEDUCED(x) \
BOOST_PP_CAT(deduced_, x)
/**/
#include <boost/preprocessor/detail/split.hpp>
#define BOOST_PARAMETER_AUX_PP_FLATTEN_QUALIFIER(sub) \
BOOST_PP_SPLIT(0, BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT(sub))
/**/
#define BOOST_PARAMETER_AUX_PP_FLATTEN_ARGS(sub) \
BOOST_PP_SPLIT(1, BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT(sub))
/**/
#include <boost/preprocessor/tuple/elem.hpp>
#define BOOST_PARAMETER_AUX_PP_FLATTEN_ARITY_optional(arities) \
BOOST_PP_TUPLE_ELEM(3, 0, arities)
/**/
#define BOOST_PARAMETER_AUX_PP_FLATTEN_ARITY_required(arities) \
BOOST_PP_TUPLE_ELEM(3, 1, arities)
/**/
#include <boost/preprocessor/arithmetic/sub.hpp>
#include <boost/preprocessor/repetition/enum_trailing.hpp>
#include <boost/preprocessor/tuple/rem.hpp>
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC0(r, n, elem, data) \
(( \
BOOST_PP_TUPLE_ELEM(3, 2, data) \
, BOOST_PP_TUPLE_REM(BOOST_PP_TUPLE_ELEM(3, 0, data)) elem \
BOOST_PP_ENUM_TRAILING( \
BOOST_PP_SUB( \
BOOST_PP_TUPLE_ELEM(3, 1, data) \
, BOOST_PP_TUPLE_ELEM(3, 0, data) \
) \
, BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC0_DUMMY_ELEM \
, ~ \
) \
))
/**/
#include <boost/parameter/aux_/preprocessor/impl/for_each.hpp>
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_AUX( \
r, arity, max_arity, spec, xform \
) \
BOOST_PARAMETER_AUX_PP_FOR_EACH_R( \
r \
, arity \
, BOOST_PARAMETER_AUX_PP_FLATTEN_ARGS(spec) \
, ( \
arity \
, max_arity \
, xform(BOOST_PARAMETER_AUX_PP_FLATTEN_QUALIFIER(spec)) \
) \
, BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC0 \
)
/**/
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_optional(r, arities, spec) \
BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_AUX( \
r \
, BOOST_PP_CAT( \
BOOST_PARAMETER_AUX_PP_FLATTEN_ARITY_ \
, BOOST_PARAMETER_AUX_PP_FLATTEN_QUALIFIER(spec) \
)(arities) \
, BOOST_PP_TUPLE_ELEM(3, 2, arities) \
, spec \
, BOOST_PARAMETER_AUX_PP_FLATTEN_IDENTITY \
)
/**/
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_required(r, arities, spec) \
BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_optional(r, arities, spec)
/**/
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_deduced_M(r, arities, n, spec) \
BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_AUX( \
r \
, BOOST_PP_CAT( \
BOOST_PARAMETER_AUX_PP_FLATTEN_ARITY_ \
, BOOST_PARAMETER_AUX_PP_FLATTEN_QUALIFIER(spec) \
)(arities) \
, BOOST_PP_TUPLE_ELEM(3, 2, arities) \
, spec \
, BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_AS_DEDUCED \
)
/**/
#include <boost/preprocessor/seq/for_each_i.hpp>
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_deduced(r, arities, spec) \
BOOST_PP_SEQ_FOR_EACH_I_R( \
r \
, BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_deduced_M \
, arities \
, BOOST_PARAMETER_AUX_PP_FLATTEN_ARGS(spec) \
)
/**/
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC(r, arities, spec) \
BOOST_PP_CAT( \
BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_ \
, BOOST_PARAMETER_AUX_PP_FLATTEN_QUALIFIER(spec) \
)(r, arities, spec)
/**/
#include <boost/preprocessor/seq/for_each.hpp>
#define BOOST_PARAMETER_AUX_PP_FLATTEN( \
opt_arity, req_arity, wanted_arity, specs \
) \
BOOST_PP_SEQ_FOR_EACH( \
BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC \
, (opt_arity, req_arity, wanted_arity) \
, specs \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,152 @@
// Copyright Daniel Wallin 2005.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FOR_EACH_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FOR_EACH_HPP
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_head_aux2(x, y) (x, y), ~
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_head_aux3(x, y, z) (x, y, z), ~
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_head_aux4(x, y, z, u) (x, y, z, u), ~
#define \
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_BOOST_PARAMETER_AUX_PP_FOR_EACH_END_S
/**/
#include <boost/preprocessor/detail/split.hpp>
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_SPLIT_FIRST(x) \
BOOST_PP_SPLIT(0, x)
/**/
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_head(n, x) \
BOOST_PP_SPLIT( \
0 \
, BOOST_PP_CAT(BOOST_PARAMETER_AUX_PP_FOR_EACH_head_aux, n) x \
)
/**/
#include <boost/preprocessor/facilities/is_empty.hpp>
#include <boost/preprocessor/logical/not.hpp>
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_check(x) \
BOOST_PP_NOT(BOOST_PP_IS_EMPTY( \
BOOST_PP_CAT(BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_, x) \
)), ~
/**/
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux2(x, y) \
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_check(x)
/**/
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux3(x, y, z) \
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_check(x)
/**/
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux4(x, y, z, u) \
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_check(x)
/**/
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux0(n, x) \
BOOST_PP_CAT(BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux, n) x
/**/
#include <boost/preprocessor/tuple/elem.hpp>
#if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred(r, state) \
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_SPLIT_FIRST( \
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux0( \
BOOST_PP_TUPLE_ELEM(5, 3, state) \
, BOOST_PP_TUPLE_ELEM(5, 0, state) \
) \
)
/**/
#else // !(BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC())
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred(r, state) \
BOOST_PP_SPLIT( \
0 \
, BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux0( \
BOOST_PP_TUPLE_ELEM(5, 3, state) \
, BOOST_PP_TUPLE_ELEM(5, 0, state) \
) \
)
/**/
#endif // BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_op(r, state) \
( \
BOOST_PP_TUPLE_EAT(BOOST_PP_TUPLE_ELEM(5, 3, state)) \
BOOST_PP_TUPLE_ELEM(5, 0, state) \
, BOOST_PP_TUPLE_ELEM(5, 1, state) \
, BOOST_PP_TUPLE_ELEM(5, 2, state) \
, BOOST_PP_TUPLE_ELEM(5, 3, state) \
, BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(5, 4, state)) \
)
/**/
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_macro(r, state) \
BOOST_PP_TUPLE_ELEM(5, 2, state)( \
r \
, BOOST_PP_TUPLE_ELEM(5, 4, state) \
, BOOST_PARAMETER_AUX_PP_FOR_EACH_head( \
BOOST_PP_TUPLE_ELEM(5, 3, state) \
, BOOST_PP_TUPLE_ELEM(5, 0, state) \
) \
, BOOST_PP_TUPLE_ELEM(5, 1, state) \
)
/**/
#include <boost/preprocessor/punctuation/comma_if.hpp>
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_build_end_sentinel(z, n, text) \
BOOST_PP_COMMA_IF(n) BOOST_PARAMETER_AUX_PP_FOR_EACH_END_S
/**/
#include <boost/preprocessor/repetition/repeat.hpp>
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_build_end_sentinel_tuple(arity) \
( \
BOOST_PP_REPEAT( \
arity, BOOST_PARAMETER_AUX_PP_FOR_EACH_build_end_sentinel, _ \
) \
)
/**/
#include <boost/preprocessor/repetition/for.hpp>
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_R(r, arity, list, data, macro) \
BOOST_PP_CAT(BOOST_PP_FOR_, r)( \
(list \
BOOST_PARAMETER_AUX_PP_FOR_EACH_build_end_sentinel_tuple(arity) \
, data \
, macro \
, arity \
, 0 \
) \
, BOOST_PARAMETER_AUX_PP_FOR_EACH_pred \
, BOOST_PARAMETER_AUX_PP_FOR_EACH_op \
, BOOST_PARAMETER_AUX_PP_FOR_EACH_macro \
)
/**/
#include <boost/preprocessor/repetition/deduce_r.hpp>
#define BOOST_PARAMETER_AUX_PP_FOR_EACH(arity, list, data, macro) \
BOOST_PARAMETER_AUX_PP_FOR_EACH_R( \
BOOST_PP_DEDUCE_R(), arity, list, data, macro \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,509 @@
// Copyright Daniel Wallin 2006.
// Copyright Cromwell D. Enage 2017.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FORWARDING_OVERLOADS_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FORWARDING_OVERLOADS_HPP
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#include <boost/preprocessor/cat.hpp>
// Expands to a forwarding parameter for a constructor or forwarding function.
#define BOOST_PARAMETER_FUNCTION_ARG_TYPE_Z(z, n, type_prefix) \
BOOST_PP_CAT(type_prefix, n)&&
/**/
#include <utility>
// Expands to an argument passed from a forwarding function to the front-end
// implementation function, or from a constructor to its delegate.
#define BOOST_PARAMETER_FUNCTION_FORWARD_PARAM_Z(z, n, type_prefix) \
::std::forward<BOOST_PP_CAT(type_prefix, n)>(BOOST_PP_CAT(a, n))
/**/
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
// Expands to the default constructor, whose job is to pass an empty back to
// the delegate constructor of the base class.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_0_Z(z, n, data) \
inline BOOST_PP_TUPLE_ELEM(2, 0, data)() \
: BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(2, 1, data))( \
BOOST_PP_CAT(constructor_parameters, __LINE__)()() \
) \
{ \
}
/**/
#include <boost/parameter/aux_/pp_impl/argument_pack.hpp>
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
// Expands to a 0-arity forwarding function, whose job is to pass an empty
// pack to the front-end implementation function.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_0_Z(z, n, data) \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4, 1, data)) \
inline BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)< \
::boost::parameter::aux::argument_pack< \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
) \
>::type \
>::type \
BOOST_PARAMETER_MEMBER_FUNCTION_NAME(BOOST_PP_TUPLE_ELEM(3, 0, data))() \
BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 3, data), const) \
{ \
return BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 2, data), this->) \
BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)( \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)()() \
); \
}
/**/
#include <boost/parameter/aux_/preprocessor/impl/function_forward_match.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
// Expands to a forwarding function, whose job is to consolidate its arguments
// into a pack for the front-end implementation function to take in.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_1_Z(z, n, data) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename ParameterArgumentType)> \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4, 1, data)) \
inline typename BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)< \
typename ::boost::parameter::aux::argument_pack< \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
) \
, BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
n \
, BOOST_PARAMETER_FUNCTION_ARG_TYPE_Z \
, ParameterArgumentType \
) \
>::type \
>::type \
BOOST_PARAMETER_MEMBER_FUNCTION_NAME(BOOST_PP_TUPLE_ELEM(4, 0, data))( \
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, ParameterArgumentType, && a) \
BOOST_PARAMETER_FUNCTION_FORWARD_MATCH_Z( \
z \
, BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
) \
, n \
, ParameterArgumentType \
) \
) BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 3, data), const) \
{ \
return BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 2, data), this->) \
BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)( \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)()( \
BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
n \
, BOOST_PARAMETER_FUNCTION_FORWARD_PARAM_Z \
, ParameterArgumentType \
) \
) \
); \
}
/**/
#include <boost/preprocessor/comparison/equal.hpp>
// Expands to a constructor whose job is to consolidate its arguments into a
// pack for the delegate constructor of the base class to take in.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_1_Z(z, n, data) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename ParameterArgumentType)> \
BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) \
inline BOOST_PP_TUPLE_ELEM(2, 0, data)( \
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, ParameterArgumentType, && a) \
BOOST_PARAMETER_FUNCTION_FORWARD_MATCH_Z( \
z \
, BOOST_PP_CAT(constructor_parameters, __LINE__) \
, n \
, ParameterArgumentType \
) \
) : BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(2, 1, data))( \
BOOST_PP_CAT(constructor_parameters, __LINE__)()( \
BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
n \
, BOOST_PARAMETER_FUNCTION_FORWARD_PARAM_Z \
, ParameterArgumentType \
) \
) \
) \
{ \
}
/**/
#include <boost/preprocessor/control/if.hpp>
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z(z, n, data) \
BOOST_PP_IF( \
n \
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_1_Z \
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_0_Z \
)(z, n, data)
/**/
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
BOOST_PP_IF( \
n \
, BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_1_Z \
, BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_0_Z \
)(z, n, data)
/**/
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
// Helper macro for BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX(nm, impl, r, is_m, c) \
BOOST_PP_REPEAT_FROM_TO( \
BOOST_PP_TUPLE_ELEM(2, 0, r) \
, BOOST_PP_TUPLE_ELEM(2, 1, r) \
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z \
, ( \
nm \
, impl \
, BOOST_PP_IF( \
BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(nm) \
, 0 \
, is_m \
) \
, c \
) \
)
/**/
// Helper macro for BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX(class_, base, range) \
BOOST_PP_REPEAT_FROM_TO( \
BOOST_PP_TUPLE_ELEM(2, 0, range) \
, BOOST_PP_TUPLE_ELEM(2, 1, range) \
, BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z \
, (class_, base) \
)
/**/
#include <boost/parameter/aux_/preprocessor/impl/arity_range.hpp>
// Expands to the layer of forwarding functions for the function with the
// specified name, whose arguments determine the range of arities.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS(name, impl, a, is_m, c) \
BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX( \
name, impl, BOOST_PARAMETER_ARITY_RANGE(a), is_m, c \
)
/**/
// Expands to the layer of forwarding functions for the constructor in the
// specified class, whose arguments determine the range of arities.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS(class_, base, args) \
BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX( \
class_, base, BOOST_PARAMETER_ARITY_RANGE(args) \
)
/**/
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/cat.hpp>
// Expands to the default constructor, whose job is to pass an empty argument
// pack back to the delegate constructor of the base class.
#define BOOST_PARAMETER_DEFAULT_CONSTRUCTOR(z, n, seq) \
inline \
BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)))() \
: BOOST_PARAMETER_PARENTHESIZED_TYPE( \
BOOST_PP_TUPLE_ELEM( \
2, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
)(BOOST_PP_CAT(constructor_parameters, __LINE__)()()) \
{ \
}
/**/
#include <boost/parameter/aux_/pp_impl/argument_pack.hpp>
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
// Expands to a 0-arity forwarding function, whose job is to pass an empty
// argument pack to the front-end implementation function.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_0_ARITY(z, n, seq) \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC( \
BOOST_PP_TUPLE_ELEM( \
4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
) \
inline BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
BOOST_PP_TUPLE_ELEM( \
4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
, BOOST_PP_TUPLE_ELEM( \
4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
)< \
::boost::parameter::aux::argument_pack< \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM( \
4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
, BOOST_PP_TUPLE_ELEM( \
4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
) \
>::type \
>::type \
BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
BOOST_PP_TUPLE_ELEM( \
4, 0, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
)() BOOST_PP_EXPR_IF( \
BOOST_PP_TUPLE_ELEM( \
4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
, const \
) \
{ \
return BOOST_PP_EXPR_IF( \
BOOST_PP_TUPLE_ELEM( \
4, 2, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
, this-> \
) BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
BOOST_PP_TUPLE_ELEM( \
4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
, BOOST_PP_TUPLE_ELEM( \
4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
)( \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM( \
4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
, BOOST_PP_TUPLE_ELEM( \
4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
)()() \
); \
}
/**/
#include <boost/parameter/aux_/preprocessor/binary_seq_to_args.hpp>
#include <boost/parameter/aux_/preprocessor/impl/function_forward_match.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/seq/size.hpp>
// Expands to a constructor whose job is to consolidate its arguments into a
// pack for the delegate constructor of the base class to take in. Each
// element in BOOST_PP_SEQ_TAIL(seq) determines the const-ness of the
// corresponding argument.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_R(r, seq) \
template < \
BOOST_PP_ENUM_PARAMS( \
BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)) \
, typename ParameterArgumentType \
) \
> \
BOOST_PP_EXPR_IF( \
BOOST_PP_EQUAL(BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)), 1) \
, explicit \
) \
inline BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_SEQ_HEAD(seq))( \
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS( \
BOOST_PP_SEQ_TAIL(seq), (ParameterArgumentType)(a) \
) \
BOOST_PARAMETER_FUNCTION_FORWARD_MATCH( \
BOOST_PP_CAT(constructor_parameters, __LINE__) \
, BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)) \
, ParameterArgumentType \
) \
) : BOOST_PARAMETER_PARENTHESIZED_TYPE( \
BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_HEAD(seq)) \
)( \
BOOST_PP_CAT(constructor_parameters, __LINE__)()( \
BOOST_PP_ENUM_PARAMS( \
BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)), a \
) \
) \
) \
{ \
}
/**/
// Expands to a forwarding function, whose job is to consolidate its arguments
// into a pack for the front-end implementation function to take in. Each
// element in BOOST_PP_SEQ_TAIL(seq) determines the const-ness of the
// corresponding argument.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_R(r, seq) \
template < \
BOOST_PP_ENUM_PARAMS( \
BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)) \
, typename ParameterArgumentType \
) \
> \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC( \
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
) \
inline typename BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
, BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)) \
)< \
typename ::boost::parameter::aux::argument_pack< \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
, BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)) \
) \
, BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS( \
BOOST_PP_SEQ_TAIL(seq), (ParameterArgumentType) \
) \
>::type \
>::type \
BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 0, BOOST_PP_SEQ_HEAD(seq)) \
)( \
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS( \
BOOST_PP_SEQ_TAIL(seq), (ParameterArgumentType)(a) \
) \
BOOST_PARAMETER_FUNCTION_FORWARD_MATCH( \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
, BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)) \
) \
, BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)) \
, ParameterArgumentType \
) \
) BOOST_PP_EXPR_IF( \
BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)), const \
) \
{ \
return BOOST_PP_EXPR_IF( \
BOOST_PP_TUPLE_ELEM(4, 2, BOOST_PP_SEQ_HEAD(seq)) \
, this-> \
) BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
, BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)) \
)( \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
, BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)) \
)()( \
BOOST_PP_ENUM_PARAMS( \
BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)), a \
) \
) \
); \
}
/**/
#include <boost/parameter/aux_/preprocessor/binary_seq_for_each.hpp>
#include <boost/preprocessor/control/if.hpp>
// Expands to all constructors that take in n arguments. Enables
// BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX to use
// BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z within BOOST_PP_REPEAT_FROM_TO.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
BOOST_PP_IF( \
n \
, BOOST_PARAMETER_AUX_PP_BINARY_SEQ_FOR_EACH_Z \
, BOOST_PARAMETER_DEFAULT_CONSTRUCTOR \
)(z, n, (BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_R)(data))
/**/
// Expands to all forwarding functions that take in n arguments. Enables
// BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX to use
// BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z within BOOST_PP_REPEAT_FROM_TO.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z(z, n, data) \
BOOST_PP_IF( \
n \
, BOOST_PARAMETER_AUX_PP_BINARY_SEQ_FOR_EACH_Z \
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_0_ARITY \
)(z, n, (BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_R)(data))
/**/
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
// Helper macro for BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX(class_, base, range) \
BOOST_PP_REPEAT_FROM_TO( \
BOOST_PP_TUPLE_ELEM(2, 0, range) \
, BOOST_PP_TUPLE_ELEM(2, 1, range) \
, BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z \
, (class_, base) \
)
/**/
// Helper macro for BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX(nm, impl, r, is_m, c) \
BOOST_PP_REPEAT_FROM_TO( \
BOOST_PP_TUPLE_ELEM(2, 0, r) \
, BOOST_PP_TUPLE_ELEM(2, 1, r) \
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z \
, ( \
nm \
, impl \
, BOOST_PP_IF( \
BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(impl) \
, 0 \
, is_m \
) \
, c \
) \
)
/**/
#include <boost/parameter/aux_/preprocessor/impl/arity_range.hpp>
// Expands to the layer of forwarding functions for the constructor in the
// specified class, whose arguments determine the range of arities.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS(class_, base, args) \
BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX( \
class_ \
, base \
, BOOST_PARAMETER_ARITY_RANGE(args) \
)
/**/
// Expands to the layer of forwarding functions for the function with the
// specified name, whose arguments determine the range of arities.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS(name, impl, a, is_m, c) \
BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX( \
name \
, impl \
, BOOST_PARAMETER_ARITY_RANGE(a) \
, is_m \
, c \
)
/**/
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#endif // include guard

View File

@@ -0,0 +1,730 @@
// Copyright Daniel Wallin 2006.
// Copyright Cromwell D. Enage 2017.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_CAST_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_CAST_HPP
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
namespace boost { namespace parameter { namespace aux {
// Handles possible implicit casts. Used by preprocessor.hpp
// to normalize user input.
//
// cast<void*>::execute() is identity
// cast<void*(X)>::execute() is identity
// cast<void(X)>::execute() casts to X
//
// preprocessor.hpp uses this like this:
//
// #define X(value, predicate)
// cast<void predicate>::execute(value)
//
// X(something, *)
// X(something, *(predicate))
// X(something, (int))
template <typename VoidExpr, typename Args>
struct cast;
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/use_default_tag.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T, typename B>
inline ::boost::parameter::aux::use_default_tag
forward(::boost::parameter::aux::use_default_tag)
{
return ::boost::parameter::aux::use_default_tag();
}
}}} // namespace boost::parameter::aux
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#include <boost/mp11/utility.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename Args>
struct cast<void*,Args>
{
template <typename T, typename B>
struct apply
{
typedef typename ::boost::mpl
::if_<B,T,::boost::mpl::true_>::type type;
};
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename T, typename B>
using fn = ::boost::mp11::mp_if<B,T,::boost::mp11::mp_true>;
#endif
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/void.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Predicate, typename Args>
struct cast<void*(Predicate),Args>
: ::boost::parameter::aux::cast<void*,Args>
{
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/placeholders.hpp>
namespace boost { namespace parameter { namespace aux {
// This is a hack used in cast<> to turn the user supplied type,
// which may or may not be a placeholder expression, into one,
// so that it will be properly evaluated by mpl::apply.
template <typename T, typename Dummy = ::boost::mpl::_1>
struct as_placeholder_expr
{
typedef T type;
};
}}} // namespace boost::parameter::aux
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/list.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Target, typename Source, typename Args>
struct apply_target_fn
{
using type = ::boost::mp11
::mp_apply_q<Target,::boost::mp11::mp_list<Source,Args> >;
};
}}} // namespace boost::parameter::aux
#endif
#include <boost/mpl/apply.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/parameter/aux_/has_nested_template_fn.hpp>
#include <type_traits>
#else
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename Target, typename Source, typename Args>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using is_target_same_as_source = ::std::is_same<
typename ::std::remove_const<
typename ::std::remove_reference<
typename ::boost::mp11::mp_if<
::boost::parameter::aux::has_nested_template_fn<Target>
, ::boost::parameter::aux
::apply_target_fn<Target,Source,Args>
, ::boost::mpl::apply2<
::boost::parameter::aux::as_placeholder_expr<Target>
, Source
, Args
>
>::type
>::type
>::type
, typename ::std::remove_const<Source>::type
>;
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
struct is_target_same_as_source
: ::boost::mpl::if_<
::boost::is_same<
typename ::boost::remove_const<
typename ::boost::remove_reference<
typename ::boost::mpl::apply2<
::boost::parameter::aux
::as_placeholder_expr<Target>
, Source
, Args
>::type
>::type
>::type
, typename ::boost::remove_const<Source>::type
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>::type
{
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/is_const.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
// Covers the case where is_convertible<Source,Target> but not
// is_same<Source,Target>. Use cases are covered
// by test/normalize_argument_types.cpp
template <typename Source, typename Target>
class cast_convert
{
typedef ::boost::parameter::aux::cast_convert<Source,Target> _self;
public:
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = typename ::boost::mp11::mp_if<
::std::is_const<Source>
, ::std::add_const<Target>
, ::std::remove_const<Target>
>::type;
#else
typedef typename boost::mpl::eval_if<
::boost::is_const<Source>
, ::boost::add_const<Target>
, ::boost::remove_const<Target>
>::type type;
#endif
private:
inline static typename _self::type
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
_copy(typename ::std::remove_const<Target>::type value)
#else
_copy(typename ::boost::remove_const<Target>::type value)
#endif
{
return value;
}
public:
inline static typename _self::type evaluate(Source&& source)
{
return _self::_copy(source);
}
};
template <typename Target, typename Source, typename Args>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using cast_impl = ::std::remove_reference<
typename ::boost::mp11::mp_if<
::boost::parameter::aux::has_nested_template_fn<Target>
, ::boost::parameter::aux
::is_target_same_as_source<Target,Source,Args>
, ::boost::mpl::apply2<
::boost::parameter::aux::as_placeholder_expr<Target>
, Source
, Args
>
>::type
>;
#else
struct cast_impl
: ::boost::remove_reference<
typename ::boost::mpl::apply2<
::boost::parameter::aux::as_placeholder_expr<Target>
, Source
, Args
>::type
>
{
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Target, typename Args>
struct cast<void(Target),Args>
{
template <typename T, typename B>
struct apply
{
typedef typename ::boost::mpl::eval_if<
B
, ::boost::mpl::eval_if<
::boost::parameter::aux
::is_target_same_as_source<Target,T,Args>
, ::boost::mpl::identity<T>
, ::boost::parameter::aux::cast_impl<Target,T,Args>
>
, ::boost::parameter::aux
::is_target_same_as_source<Target,T,Args>
>::type type;
};
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename T, typename B>
using fn = typename ::boost::mp11::mp_if<
B
, ::boost::mp11::mp_if<
::boost::parameter::aux
::is_target_same_as_source<Target,T,Args>
, ::boost::mp11::mp_identity<T>
, ::boost::parameter::aux::cast_impl<Target,T,Args>
>
, ::boost::parameter::aux
::is_target_same_as_source<Target,T,Args>
>::type;
#endif
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/value_type.hpp>
#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mpl/apply_wrap.hpp>
#endif
// Expands to the target type of the argument as indicated by the predicate.
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#define BOOST_PARAMETER_FUNCTION_CAST_T(tag, predicate, args) \
::boost::mp11::mp_apply_q< \
::boost::parameter::aux::cast<void predicate, args> \
, ::boost::mp11::mp_list< \
typename ::boost::parameter::value_type< \
args \
, tag \
, ::boost::parameter::aux::use_default_tag \
>::type \
, ::boost::mp11::mp_true \
> \
>
/**/
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
#define BOOST_PARAMETER_FUNCTION_CAST_T(tag, predicate, args) \
typename ::boost::mpl::apply_wrap2< \
::boost::parameter::aux::cast<void predicate, args> \
, typename ::boost::parameter::value_type< \
args \
, tag \
, ::boost::parameter::aux::use_default_tag \
>::type \
, ::boost::mpl::true_ \
>::type
/**/
#endif // BOOST_PARAMETER_CAN_USE_MP11
// Expands to boost::mpl::true_ if and only if the argument's source and
// target types are the same.
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#define BOOST_PARAMETER_FUNCTION_CAST_B(tag, predicate, args) \
::boost::mp11::mp_apply_q< \
::boost::parameter::aux::cast<void predicate, args> \
, ::boost::mp11::mp_list< \
typename ::boost::parameter::value_type< \
args \
, tag \
, ::boost::parameter::aux::use_default_tag \
>::type \
, ::boost::mp11::mp_false \
> \
>
/**/
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
#define BOOST_PARAMETER_FUNCTION_CAST_B(tag, predicate, args) \
typename ::boost::mpl::apply_wrap2< \
::boost::parameter::aux::cast<void predicate, args> \
, typename ::boost::parameter::value_type< \
args \
, tag \
, ::boost::parameter::aux::use_default_tag \
>::type \
, ::boost::mpl::false_ \
>::type
/**/
#endif // BOOST_PARAMETER_CAN_USE_MP11
#include <boost/core/enable_if.hpp>
#include <utility>
namespace boost { namespace parameter { namespace aux {
// If the source and target types are not the same,
// then perform an implicit conversion.
template <typename Target, typename B, typename Source>
inline typename ::boost::lazy_disable_if<
B
, ::boost::parameter::aux::cast_convert<Source,Target>
>::type
forward(Source&& source)
{
return ::boost::parameter::aux::cast_convert<Source,Target>
::evaluate(::std::forward<Source>(source));
}
// If the source and target types are the same,
// then simply forward the argument.
// However, treat rvalue references to scalars as const lvalue references.
template <typename T, typename B>
inline typename ::boost::enable_if<B,T const&>::type forward(T const& t)
{
return t;
}
template <typename T, typename B>
inline typename ::boost::enable_if<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_if<
B
, ::boost::mp11::mp_if<
::std::is_const<T>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>
, ::boost::mp11::mp_false
>
#else
typename ::boost::mpl::eval_if<
B
, ::boost::mpl::if_<
::boost::is_const<T>
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, ::boost::mpl::false_
>::type
#endif // BOOST_PARAMETER_CAN_USE_MP11
, T&
>::type
forward(T& t)
{
return t;
}
}}} // namespace boost::parameter::aux
#include <boost/type_traits/is_scalar.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T, typename B>
inline typename ::boost::enable_if<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_if<
B
, ::boost::mp11::mp_if<
::std::is_scalar<T>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>
, ::boost::mp11::mp_false
>
#else
typename ::boost::mpl::eval_if<
B
, ::boost::mpl::if_<
::boost::is_scalar<T>
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, ::boost::mpl::false_
>::type
#endif // BOOST_PARAMETER_CAN_USE_MP11
, T const&&
>::type
forward(T const&& t)
{
return static_cast<T const&&>(t);
}
template <typename T, typename B>
inline typename ::boost::enable_if<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_if<
B
, ::boost::mp11::mp_if<
::std::is_scalar<T>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>
, ::boost::mp11::mp_false
>
#else
typename ::boost::mpl::eval_if<
B
, ::boost::mpl::if_<
::boost::is_scalar<T>
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, ::boost::mpl::false_
>::type
#endif // BOOST_PARAMETER_CAN_USE_MP11
, T&&
>::type
forward(T&& t)
{
return ::std::forward<T>(t);
}
}}} // namespace boost::parameter::aux
#elif BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
#define BOOST_PARAMETER_FUNCTION_CAST_T(value_t, predicate, args) value_t
#define BOOST_PARAMETER_FUNCTION_CAST_B(value, predicate, args) value
#else // no perfect forwarding support and no Borland workarounds needed
namespace boost { namespace parameter { namespace aux {
// Handles possible implicit casts. Used by preprocessor.hpp
// to normalize user input.
//
// cast<void*>::execute() is identity
// cast<void*(X)>::execute() is identity
// cast<void(X)>::execute() casts to X
//
// preprocessor.hpp uses this like this:
//
// #define X(value, predicate)
// cast<void predicate>::execute(value)
//
// X(something, *)
// X(something, *(predicate))
// X(something, (int))
template <typename VoidExpr, typename Args>
struct cast;
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/use_default_tag.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Args>
struct cast<void*,Args>
{
template <typename T>
struct apply
{
typedef T& type;
};
inline static ::boost::parameter::aux::use_default_tag
execute(::boost::parameter::aux::use_default_tag)
{
return ::boost::parameter::aux::use_default_tag();
}
template <typename U>
inline static U& execute(U& value)
{
return value;
}
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/void.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Predicate, typename Args>
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
struct cast< ::boost::parameter::aux::voidstar(Predicate),Args>
#else
struct cast<void*(Predicate),Args>
#endif
: ::boost::parameter::aux::cast<void*,Args>
{
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/placeholders.hpp>
namespace boost { namespace parameter { namespace aux {
// This is a hack used in cast<> to turn the user supplied type,
// which may or may not be a placeholder expression, into one,
// so that it will be properly evaluated by mpl::apply.
template <typename T, typename Dummy = ::boost::mpl::_1>
struct as_placeholder_expr
{
typedef T type;
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/apply.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Target, typename Source, typename Args>
struct is_target_same_as_source
: ::boost::mpl::if_<
::boost::is_same<
typename ::boost::remove_const<
typename ::boost::remove_reference<
typename ::boost::mpl::apply2<
::boost::parameter::aux
::as_placeholder_expr<Target>
, Source
, Args
>::type
>::type
>::type
, typename ::boost::remove_const<Source>::type
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>::type
{
};
template <
typename Target
, typename Source
, typename Args
, typename Enable = ::boost::parameter::aux
::is_target_same_as_source<Target,Source,Args>
>
struct cast_impl
{
typedef Source& type;
inline static Source& evaluate(Source& value)
{
return value;
}
};
}}} // namespace boost::parameter::aux
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/add_lvalue_reference.hpp>
namespace boost { namespace parameter { namespace aux {
// Covers the case where is_convertible<Source,Target> but not
// is_same<Source,Target>. Use cases are covered
// by test/normalize_argument_types.cpp
template <typename Source, typename Target>
class cast_convert
{
typedef ::boost::parameter::aux::cast_convert<Source,Target> _self;
public:
typedef typename ::boost::add_lvalue_reference<
typename ::boost::add_const<Target>::type
>::type type;
private:
template <typename U>
inline static typename _self::type _mod_const(U const& u)
{
return u;
}
inline static Target _copy(Target value)
{
return value;
}
public:
inline static typename _self::type evaluate(Source& source)
{
return _self::_mod_const(_self::_copy(source));
}
};
template <typename Target, typename Source, typename Args>
struct cast_impl<Target,Source,Args,::boost::mpl::false_>
: ::boost::parameter::aux::cast_convert<
Source,
typename ::boost::mpl::apply2<
::boost::parameter::aux::as_placeholder_expr<Target>
, Source
, Args
>::type
>
{
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/eval_if.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Target, typename Args>
struct cast<void(Target),Args>
{
template <typename T>
struct apply
{
typedef typename ::boost::mpl::eval_if<
::boost::parameter::aux
::is_target_same_as_source<Target,T,Args>
, ::boost::add_lvalue_reference<T>
, ::boost::parameter::aux::cast_impl<
Target
, T
, Args
, ::boost::mpl::false_
>
>::type type;
};
inline static ::boost::parameter::aux::use_default_tag
execute(::boost::parameter::aux::use_default_tag)
{
return ::boost::parameter::aux::use_default_tag();
}
template <typename U>
inline static typename ::boost::parameter::aux
::cast_impl<Target,U const,Args>::type
execute(U const& value)
{
return ::boost::parameter::aux
::cast_impl<Target,U const,Args>::evaluate(value);
}
template <typename U>
inline static typename ::boost::parameter::aux
::cast_impl<Target,U,Args>::type
execute(U& value)
{
return ::boost::parameter::aux
::cast_impl<Target,U,Args>::evaluate(value);
}
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/apply_wrap.hpp>
#include <boost/parameter/value_type.hpp>
// Expands to the reference-qualified target type of the argument
// as indicated by the predicate.
#define BOOST_PARAMETER_FUNCTION_CAST_T(tag, predicate, args) \
typename ::boost::mpl::apply_wrap1< \
::boost::parameter::aux::cast<void predicate, args> \
, typename ::boost::parameter::value_type< \
args \
, tag \
, ::boost::parameter::aux::use_default_tag \
>::type \
>::type
/**/
// Expands to the converted or passed-through value
// as indicated by the predicate.
#define BOOST_PARAMETER_FUNCTION_CAST_B(value, predicate, args) \
::boost::parameter::aux::cast<void predicate, args>::execute(value)
/**/
#endif // perfect forwarding support, or Borland workarounds needed
#endif // include guard

View File

@@ -0,0 +1,474 @@
// Copyright Daniel Wallin 2006.
// Copyright Cromwell D. Enage 2017.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_DISPATCH_LAYER_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_DISPATCH_LAYER_HPP
#include <boost/preprocessor/cat.hpp>
// Expands to keyword_tag_type for some keyword_tag.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE(keyword_tag) \
BOOST_PP_CAT(keyword_tag, _type)
/**/
// Expands to a template parameter for each dispatch function.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_TEMPLATE_ARG(r, macro, arg) \
, typename BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE(macro(arg))
/**/
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
// Expands to a forwarding parameter for a dispatch function.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_DEFN(r, macro, arg) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE(macro(arg))&& macro(arg)
/**/
#include <utility>
// Expands to an argument passed from one dispatch function to the next.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_FWD(r, macro, arg) \
, ::std::forward< \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE(macro(arg)) \
>(macro(arg))
/**/
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
// Expands to a forwarding parameter for a dispatch function. The parameter
// type stores its const-ness.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_DEFN(r, macro, arg) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE(macro(arg))& macro(arg)
/**/
#include <boost/parameter/aux_/as_lvalue.hpp>
// Expands to an argument passed from one dispatch function to the next.
// Explicit forwarding takes the form of forcing the argument to be an lvalue.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_FWD(r, macro, arg) \
, ::boost::parameter::aux::as_lvalue(macro(arg))
/**/
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp>
#include <boost/parameter/aux_/preprocessor/impl/split_args.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/first_n.hpp>
// Iterates through all required arguments and the first n optional arguments,
// passing each argument to the specified macro.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT(macro, n, split_args) \
BOOST_PP_SEQ_FOR_EACH( \
macro \
, BOOST_PARAMETER_FN_ARG_NAME \
, BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ(split_args) \
) \
BOOST_PP_SEQ_FOR_EACH( \
macro \
, BOOST_PARAMETER_FN_ARG_NAME \
, BOOST_PP_SEQ_FIRST_N( \
n, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(split_args) \
) \
)
/**/
#include <boost/parameter/aux_/preprocessor/impl/function_dispatch_tuple.hpp>
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
#include <boost/preprocessor/control/if.hpp>
// Produces a name for the dispatch functions.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, n) \
BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_IF( \
BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x) \
, boost_param_dispatch_const_ \
, boost_param_dispatch_ \
) \
, BOOST_PP_CAT(BOOST_PP_CAT(n, boost_), __LINE__) \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
) \
)
/**/
// Expands to the template parameter list of the dispatch function with all
// required and first n optional parameters; also extracts the static keyword
// if present.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
template < \
typename ResultType, typename Args \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_TEMPLATE_ARG \
, n \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
> BOOST_PARAMETER_MEMBER_FUNCTION_STATIC( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
)
/**/
#include <boost/parameter/aux_/use_default_tag.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
// Expands to the result type, name, parenthesized list of all required and
// n optional parameters, and const-ness of the dispatch function; the bit
// value b determines whether or not this dispatch function takes in
// boost::parameter::aux::use_default_tag as its last parameter.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, b1, b2) \
ResultType BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, b1)( \
ResultType(*)(), Args const& args, long \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_DEFN \
, n \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
BOOST_PP_COMMA_IF(b2) \
BOOST_PP_EXPR_IF(b2, ::boost::parameter::aux::use_default_tag) \
) BOOST_PP_EXPR_IF(BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x), const)
/**/
// Expands to a forward declaration of the dispatch function that takes in
// all required and the first n optional parameters, but not
// boost::parameter::aux::use_default_tag.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_FWD_DECL_0_Z(z, n, x) \
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, 0, 0);
/**/
// Expands to a forward declaration of the dispatch function that takes in
// all required parameters, the first n optional parameters, and
// boost::parameter::aux::use_default_tag.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_FWD_DECL_1_Z(z, n, x) \
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, 0, 1);
/**/
#include <boost/preprocessor/seq/elem.hpp>
// Expands to the default value of the (n + 1)th optional parameter.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_DEFAULT_AUX(n, s_args) \
BOOST_PARAMETER_FN_ARG_DEFAULT( \
BOOST_PP_SEQ_ELEM(n, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(s_args)) \
)
/**/
#include <boost/parameter/keyword.hpp>
// Expands to the assignment portion which binds the default value to the
// (n + 1)th optional parameter before composing it with the argument-pack
// parameter passed in to the n-th dispatch function.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_DEFAULT(n, s_args, tag_ns) \
::boost::parameter::keyword< \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME( \
BOOST_PP_SEQ_ELEM(n, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(s_args)) \
) \
>::instance = BOOST_PARAMETER_FUNCTION_DISPATCH_DEFAULT_AUX(n, s_args)
/**/
#include <boost/parameter/aux_/preprocessor/impl/function_cast.hpp>
// Takes in the arg tuple (name, pred) and the tag namespace.
// Extracts the corresponding required argument from the pack.
// This form enables BOOST_PARAMETER_FUNCTION_DISPATCH_LAYER to use it
// from within BOOST_PP_SEQ_FOR_EACH.
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
// The boost::parameter::aux::forward wrapper is necessary to transmit the
// target type to the next dispatch function. Otherwise, the argument will
// retain its original type. -- Cromwell D. Enage
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_CAST_R(r, tag_ns, arg) \
, ::boost::parameter::aux::forward< \
BOOST_PARAMETER_FUNCTION_CAST_T( \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
, Args \
) \
, BOOST_PARAMETER_FUNCTION_CAST_B( \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
, Args \
) \
>( \
args[ \
::boost::parameter::keyword< \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
>::instance \
] \
)
/**/
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
// The explicit type cast is necessary to transmit the target type to the next
// dispatch function. Otherwise, the argument will retain its original type.
// -- Cromwell D. Enage
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_CAST_R(r, tag_ns, arg) \
, BOOST_PARAMETER_FUNCTION_CAST_T( \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
, Args \
)( \
args[ \
::boost::parameter::keyword< \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
>::instance \
] \
)
/**/
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
// Takes in the arg tuple (name, pred, default) and the tag namespace.
// Extracts the corresponding optional argument from the pack if specified,
// otherwise temporarily passes use_default_tag() to the dispatch functions.
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
// The boost::parameter::aux::forward wrapper is necessary to transmit the
// target type to the next dispatch function. Otherwise, the argument will
// retain its original type. -- Cromwell D. Enage
#define BOOST_PARAMETER_FUNCTION_DISPATCH_OPT_ARG_CAST(arg, tag_ns) \
::boost::parameter::aux::forward< \
BOOST_PARAMETER_FUNCTION_CAST_T( \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
, Args \
) \
, BOOST_PARAMETER_FUNCTION_CAST_B( \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
, Args \
) \
>( \
args[ \
::boost::parameter::keyword< \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
>::instance || ::boost::parameter::aux::use_default_tag() \
] \
)
/**/
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#define BOOST_PARAMETER_FUNCTION_DISPATCH_OPT_ARG_CAST(arg, tag_ns) \
BOOST_PARAMETER_FUNCTION_CAST_B( \
args[ \
::boost::parameter::keyword< \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
>::instance || ::boost::parameter::aux::use_default_tag() \
] \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
, Args \
)
/**/
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
// Expands to three dispatch functions that take in all required parameters
// and the first n optional parameters. The third dispatch function bears
// the same name as the first but takes in use_default_tag as the last
// parameter. The second dispatch function bears a different name from the
// other two.
//
// x is a tuple:
//
// (name, split_args, is_const, tag_namespace)
//
// Where name is the base name of the functions, and split_args is a tuple:
//
// (required_count, required_args, optional_count, required_args)
//
// The first dispatch function queries args if it has bound the (n + 1)th
// optional parameter to a user-defined argument. If so, then it forwards
// its own arguments followed by the user-defined argument to the dispatch
// function that takes in all required parameters and the first (n + 1)
// optional parameters, but not use_default_tag. Otherwise, it forwards
// its own arguments to the third dispatch function.
//
// The third dispatch function appends the default value of the (n + 1)th
// optional parameter to its copy of args. Then it forwards this copy, all
// required parameters, and the first n (not n + 1) optional parameters to
// the second dispatch function.
//
// The second dispatch function forwards its arguments, then the (n + 1)th
// optional parameter that it extracts from args, to the other-named dispatch
// function that takes in all required parameters and the first (n + 1)
// optional parameters, but not use_default_tag.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_OVERLOAD_Z(z, n, x) \
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
inline BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, 0, 0) \
{ \
return BOOST_PP_EXPR_IF( \
BOOST_PARAMETER_FUNCTION_DISPATCH_IS_MEMBER(x) \
, this-> \
) BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 0)( \
static_cast<ResultType(*)()>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
, args \
, 0L \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_FWD \
, n \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_OPT_ARG_CAST( \
BOOST_PP_SEQ_ELEM( \
n \
, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x) \
) \
); \
} \
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
inline BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, 1, 0) \
{ \
return BOOST_PP_EXPR_IF( \
BOOST_PARAMETER_FUNCTION_DISPATCH_IS_MEMBER(x) \
, this-> \
) BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 0)( \
static_cast<ResultType(*)()>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
, args \
, 0L \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_FWD \
, n \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, args[ \
::boost::parameter::keyword< \
BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x):: \
BOOST_PARAMETER_FN_ARG_NAME( \
BOOST_PP_SEQ_ELEM( \
n \
, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
) \
) \
>::instance \
] \
); \
} \
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
inline BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, 0, 1) \
{ \
return BOOST_PP_EXPR_IF( \
BOOST_PARAMETER_FUNCTION_DISPATCH_IS_MEMBER(x) \
, this-> \
) BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 1)( \
static_cast<ResultType(*)()>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
, (args \
, BOOST_PARAMETER_FUNCTION_DISPATCH_DEFAULT( \
n \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x) \
) \
) \
, 0L \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_FWD \
, n \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
); \
}
/**/
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
// x is a tuple:
//
// (base_name, split_args, is_member, is_const, tag_namespace)
//
// Generates all dispatch functions for the function named base_name. Each
// dispatch function that takes in n optional parameters passes the default
// value of the (n + 1)th optional parameter to the next dispatch function.
// The last dispatch function is the back-end implementation, so only the
// header is generated: the user is expected to supply the body.
//
// Also generates the front-end implementation function, which uses
// BOOST_PARAMETER_FUNCTION_CAST to extract each argument from the argument
// pack.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_LAYER(fwd_decl, x) \
BOOST_PP_IF(fwd_decl, BOOST_PP_REPEAT_FROM_TO, BOOST_PP_TUPLE_EAT(4))( \
0 \
, BOOST_PP_INC( \
BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_FWD_DECL_0_Z \
, x \
) \
BOOST_PP_IF(fwd_decl, BOOST_PP_REPEAT_FROM_TO, BOOST_PP_TUPLE_EAT(4))( \
0 \
, BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_FWD_DECL_1_Z \
, x \
) \
template <typename Args> BOOST_PARAMETER_MEMBER_FUNCTION_STATIC( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
) inline typename BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x) \
)<Args>::type BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x) \
)(Args const& args) \
BOOST_PP_EXPR_IF(BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x), const) \
{ \
return BOOST_PP_EXPR_IF( \
BOOST_PARAMETER_FUNCTION_DISPATCH_IS_MEMBER(x) \
, this-> \
) BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 0)( \
static_cast< \
typename BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x) \
)<Args>::type(*)() \
>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
, args \
, 0L \
BOOST_PP_SEQ_FOR_EACH( \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_CAST_R \
, BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x) \
, BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
) \
); \
} \
BOOST_PP_REPEAT_FROM_TO( \
0 \
, BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_OVERLOAD_Z \
, x \
) \
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL( \
BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, x \
) \
inline BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN( \
BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, x \
, 0 \
, 0 \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,33 @@
// Copyright Daniel Wallin 2006.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_DISPATCH_TUPLE_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_DISPATCH_TUPLE_HPP
#include <boost/preprocessor/tuple/elem.hpp>
// Accessor macros for the input tuple to the dispatch macros.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
BOOST_PP_TUPLE_ELEM(5, 0, x)
/**/
#define BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
BOOST_PP_TUPLE_ELEM(5, 1, x)
/**/
#define BOOST_PARAMETER_FUNCTION_DISPATCH_IS_MEMBER(x) \
BOOST_PP_TUPLE_ELEM(5, 2, x)
/**/
#define BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x) \
BOOST_PP_TUPLE_ELEM(5, 3, x)
/**/
#define BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x) \
BOOST_PP_TUPLE_ELEM(5, 4, x)
/**/
#endif // include guard

View File

@@ -0,0 +1,43 @@
// Copyright Daniel Wallin 2006.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_FORWARD_MATCH_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_FORWARD_MATCH_HPP
#include <boost/parameter/config.hpp>
#if !defined(BOOST_NO_SFINAE) && \
!BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x592))
#include <boost/parameter/aux_/pp_impl/match.hpp>
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
// Expands to an extra argument that is well-formed
// iff all Args... satisfy the requirements set by params.
#define BOOST_PARAMETER_FUNCTION_FORWARD_MATCH(params, n, prefix) \
, typename ::boost::parameter::aux::match< \
params BOOST_PP_ENUM_TRAILING_PARAMS(n, prefix) \
>::type = params()
/**/
#define BOOST_PARAMETER_FUNCTION_FORWARD_MATCH_Z(z, params, n, prefix) \
, typename ::boost::parameter::aux::match< \
params BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, prefix) \
>::type = params()
/**/
#else // SFINAE/Borland workarounds needed.
#define BOOST_PARAMETER_FUNCTION_FORWARD_MATCH(params, n, prefix) \
, params = params()
/**/
#define BOOST_PARAMETER_FUNCTION_FORWARD_MATCH_Z(z, params, n, prefix) \
, params = params()
/**/
#endif
#endif // include guard

View File

@@ -0,0 +1,152 @@
// Copyright Daniel Wallin 2006.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_NAME_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_NAME_HPP
#define BOOST_PARAMETER_MEMBER_FUNCTION_CHECK_STATIC_static ()
/**/
#include <boost/parameter/aux_/preprocessor/is_nullary.hpp>
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name) \
BOOST_PARAMETER_IS_NULLARY( \
BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_CHECK_STATIC_, name) \
)
/**/
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
// Workaround for MSVC preprocessor.
//
// When stripping static from "static f", msvc will produce " f". The leading
// whitespace doesn't go away when pasting the token with something else, so
// this thing is a hack to strip the whitespace.
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_static (
/**/
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_AUX(name) \
BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_, name))
/**/
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC(name) \
BOOST_PP_SEQ_HEAD( \
BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_AUX(name) \
)
/**/
#else
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_static
/**/
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC(name) \
BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_, name)
/**/
#endif // MSVC workarounds needed
#include <boost/preprocessor/control/expr_if.hpp>
#define BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name) \
BOOST_PP_EXPR_IF( \
BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name), static \
)
/**/
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#define BOOST_PARAMETER_MEMBER_FUNCTION_NAME(name) \
BOOST_PP_IF( \
BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name) \
, BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC \
, name BOOST_PP_TUPLE_EAT(1) \
)(name)
/**/
// Produces a name for a parameter specification for the function named base.
#define BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(base, is_const) \
BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_IF( \
is_const \
, boost_param_parameters_const_ \
, boost_param_parameters_ \
) \
, __LINE__ \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
)
/**/
// Produces a name for a result type metafunction for the no-spec function
// named base.
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME(base, is_const) \
BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_IF( \
is_const \
, boost_param_no_spec_result_const_ \
, boost_param_no_spec_result_ \
) \
, __LINE__ \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
)
/**/
// Produces a name for a result type metafunction for the function named base.
#define BOOST_PARAMETER_FUNCTION_RESULT_NAME(base, is_const) \
BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_IF( \
is_const \
, boost_param_result_const_ \
, boost_param_result_ \
) \
, __LINE__ \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
)
/**/
// Produces a name for the implementation function to which the no-spec
// function named base forwards its result type and argument pack.
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME(base, is_const) \
BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_IF( \
is_const \
, boost_param_no_spec_impl_const \
, boost_param_no_spec_impl \
) \
, __LINE__ \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
)
/**/
// Can't do boost_param_impl_ ## basee
// because base might start with an underscore.
// daniel: what? how is that relevant? the reason for using CAT()
// is to make sure base is expanded. i'm not sure we need to here,
// but it's more stable to do it.
#define BOOST_PARAMETER_FUNCTION_IMPL_NAME(base, is_const) \
BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_IF(is_const, boost_param_impl_const, boost_param_impl) \
, __LINE__ \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,331 @@
// Copyright Cromwell D. Enage 2018.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_NO_SPEC_OVERLOADS_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_NO_SPEC_OVERLOADS_HPP
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
// Defines the no-spec implementation function header.
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_HEAD(name, is_const) \
template <typename ResultType, typename Args> \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name) ResultType \
BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME( \
name, is_const \
)(ResultType(*)(), Args const& args)
/**/
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_return_type.hpp>
// Expands to the result metafunction for the specified no-spec function.
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_HEAD(result, name, is_const) \
template <typename TaggedArg0, typename ...TaggedArgs> \
using BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME(name, is_const) \
= typename BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(result);
/**/
#else
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_HEAD(result, name, is_const) \
template <typename TaggedArg0, typename ...TaggedArgs> \
struct BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME(name, is_const) \
: BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(result) \
{ \
};
/**/
#endif // BOOST_PARAMETER_CAN_USE_MP11
#include <boost/parameter/compose.hpp>
#include <boost/parameter/are_tagged_arguments.hpp>
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
#include <boost/core/enable_if.hpp>
// Exapnds to a variadic constructor that is enabled if and only if all its
// arguments are tagged arguments. The enclosing class must inherit from the
// specified base class, which in turn must implement a constructor that takes
// in the argument pack that this one passes on.
#define BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(class_, base) \
template < \
typename TaggedArg0 \
, typename ...TaggedArgs \
, typename = typename ::boost::enable_if< \
::boost::parameter \
::are_tagged_arguments<TaggedArg0,TaggedArgs...> \
>::type \
> inline explicit \
class_(TaggedArg0 const& arg0, TaggedArgs const&... args) \
: BOOST_PARAMETER_PARENTHESIZED_TYPE(base)( \
::boost::parameter::compose(arg0, args...) \
) \
{ \
}
/**/
// Exapnds to a variadic constructor that is enabled if and only if all its
// arguments are tagged arguments. The specified function must be able to
// take in the argument pack that this constructor passes on.
#define BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(class_, func) \
template < \
typename TaggedArg0 \
, typename ...TaggedArgs \
, typename = typename ::boost::enable_if< \
::boost::parameter \
::are_tagged_arguments<TaggedArg0,TaggedArgs...> \
>::type \
> inline explicit \
class_(TaggedArg0 const& arg0, TaggedArgs const&... args) \
{ \
func(::boost::parameter::compose(arg0, args...)); \
}
/**/
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
// Exapnds to a variadic function that is enabled if and only if
// all its arguments are tagged arguments.
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD(name, impl, is_m, c) \
template <typename TaggedArg0, typename ...TaggedArgs> \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(impl) \
inline typename ::boost::lazy_enable_if< \
::boost::parameter \
::are_tagged_arguments<TaggedArg0,TaggedArgs...> \
, BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
impl, c \
)<TaggedArg0,TaggedArgs...> \
>::type BOOST_PARAMETER_MEMBER_FUNCTION_NAME(name) \
(TaggedArg0 const& arg0, TaggedArgs const&... args) \
BOOST_PP_EXPR_IF(c, const) \
{ \
return BOOST_PP_EXPR_IF(is_m, this->) \
BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME(impl, c)( \
static_cast< \
typename BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
impl, c \
)<TaggedArg0,TaggedArgs...>::type(*)() \
>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
, ::boost::parameter::compose(arg0, args...) \
); \
}
/**/
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#include <boost/parameter/aux_/void.hpp>
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_return_type.hpp>
#include <boost/preprocessor/facilities/intercept.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
// Expands to the result metafunction for the specified no-spec function.
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_HEAD(result, name, is_const) \
template < \
BOOST_PP_ENUM_BINARY_PARAMS( \
BOOST_PARAMETER_COMPOSE_MAX_ARITY \
, typename TaggedArg \
, = ::boost::parameter::void_ BOOST_PP_INTERCEPT \
) \
> \
struct BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME(name, is_const) \
: BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(result) \
{ \
};
/**/
#include <boost/parameter/compose.hpp>
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#if defined(BOOST_NO_SFINAE)
// Exapnds to a tagged-argument constructor overload that passes the argument
// pack to the base class delegate constructor.
#define BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) inline \
BOOST_PP_TUPLE_ELEM(2, 0, data)( \
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& arg) \
) : BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(2, 1, data))( \
::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, arg)) \
) \
{ \
}
/**/
// Exapnds to a tagged-argument constructor overload that passes the argument
// pack to the delegate function.
#define BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) inline \
BOOST_PP_TUPLE_ELEM(2, 0, data)( \
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& a) \
) \
{ \
BOOST_PP_TUPLE_ELEM(2, 1, data)( \
::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, a)) \
); \
}
/**/
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
// Exapnds to a tagged-argument function overload.
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD_Z(z, n, data) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4, 1, data)) \
inline typename BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)>::type \
BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 0, data) \
)(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& arg)) \
BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 3, data), const) \
{ \
return BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 2, data), this->) \
BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)( \
static_cast< \
typename BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)>::type(*)() \
>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
, ::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, arg)) \
); \
}
/**/
#else // !defined(BOOST_NO_SFINAE)
#include <boost/parameter/are_tagged_arguments.hpp>
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
#include <boost/core/enable_if.hpp>
// Exapnds to a tagged-argument constructor overload that passes the argument
// pack to the base class delegate constructor. This constructor is enabled
// if and only if all its arguments are tagged arguments.
#define BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) inline \
BOOST_PP_TUPLE_ELEM(2, 0, data)( \
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& arg) \
, typename ::boost::enable_if< \
::boost::parameter::are_tagged_arguments< \
BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg) \
> \
>::type* = BOOST_PARAMETER_AUX_PP_NULLPTR \
) : BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(2, 1, data))( \
::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, arg)) \
) \
{ \
}
/**/
// Exapnds to a tagged-argument constructor overload that passes the argument
// pack to the delegate function. This constructor is enabled if and only if
// all its arguments are tagged arguments.
#define BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) inline \
BOOST_PP_TUPLE_ELEM(2, 0, data)( \
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& a) \
, typename ::boost::enable_if< \
::boost::parameter::are_tagged_arguments< \
BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg) \
> \
>::type* = BOOST_PARAMETER_AUX_PP_NULLPTR \
) \
{ \
BOOST_PP_TUPLE_ELEM(2, 1, data)( \
::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, a)) \
); \
}
/**/
// Exapnds to a function overload that is enabled if and only if
// all its arguments are tagged arguments.
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD_Z(z, n, data) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4, 1, data)) \
inline typename ::boost::lazy_enable_if< \
::boost::parameter \
::are_tagged_arguments<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)> \
, BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)> \
>::type BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 0, data) \
)(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& arg)) \
BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 3, data), const) \
{ \
return BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 2, data), this->) \
BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)( \
static_cast< \
typename BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)>::type(*)() \
>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
, ::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, arg)) \
); \
}
/**/
#endif // BOOST_NO_SFINAE
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
// Emulates a variadic constructor that is enabled if and only if all its
// arguments are tagged arguments. The enclosing class must inherit from the
// specified base class, which in turn must implement a constructor that takes
// in the argument pack that this one passes on.
#define BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(class_, base) \
BOOST_PP_REPEAT_FROM_TO( \
1 \
, BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY) \
, BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR_OVERLOAD_Z \
, (class_, base) \
)
/**/
// Emulates a variadic constructor that is enabled if and only if all its
// arguments are tagged arguments. The specified function must be able to
// take in the argument pack that this constructor passes on.
#define BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(class_, func) \
BOOST_PP_REPEAT_FROM_TO( \
1 \
, BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY) \
, BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR_OVERLOAD_Z \
, (class_, func) \
)
/**/
// Emulates a variadic function that is enabled if and only if
// all its arguments are tagged arguments.
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD(name, impl, is_m, c) \
BOOST_PP_REPEAT_FROM_TO( \
1 \
, BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY) \
, BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD_Z \
, (name, impl, is_m, c) \
)
/**/
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#endif // include guard

View File

@@ -0,0 +1,122 @@
// Copyright Cromwell D. Enage 2019.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_PARENTHESIZED_RETURN_TYPE_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_PARENTHESIZED_RETURN_TYPE_HPP
namespace boost { namespace parameter { namespace aux {
// A metafunction that transforms void(*)(T) -> identity<T>
template <typename UnaryFunctionPointer>
struct unaryfunptr_return_type;
}}} // namespace boost::parameter::aux
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/utility.hpp>
#else
#include <boost/mpl/identity.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename Arg>
struct unaryfunptr_return_type<void(*)(Arg)>
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = ::boost::mp11::mp_identity<Arg>;
#else
typedef ::boost::mpl::identity<Arg> type;
#endif
};
template <>
struct unaryfunptr_return_type<void(*)(void)>
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = ::boost::mp11::mp_identity<void>;
#else
typedef ::boost::mpl::identity<void> type;
#endif
};
}}} // namespace boost::parameter::aux
#if !defined(BOOST_NO_SFINAE)
#include <boost/core/enable_if.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Pred, typename Ret>
struct unaryfunptr_return_type<void(*)(::boost::enable_if<Pred,Ret>)>
{
typedef ::boost::enable_if<Pred,Ret> type;
};
template <bool b, typename Ret>
struct unaryfunptr_return_type<void(*)(::boost::enable_if_c<b,Ret>)>
{
typedef ::boost::enable_if_c<b,Ret> type;
};
template <typename Pred, typename Ret>
struct unaryfunptr_return_type<void(*)(::boost::lazy_enable_if<Pred,Ret>)>
{
typedef ::boost::lazy_enable_if<Pred,Ret> type;
};
template <bool b, typename Ret>
struct unaryfunptr_return_type<void(*)(::boost::lazy_enable_if_c<b,Ret>)>
{
typedef ::boost::lazy_enable_if_c<b,Ret> type;
};
template <typename Pred, typename Ret>
struct unaryfunptr_return_type<void(*)(::boost::disable_if<Pred,Ret>)>
{
typedef ::boost::disable_if<Pred,Ret> type;
};
template <bool b, typename Ret>
struct unaryfunptr_return_type<void(*)(::boost::disable_if_c<b,Ret>)>
{
typedef ::boost::disable_if_c<b,Ret> type;
};
template <typename B, typename Ret>
struct unaryfunptr_return_type<void(*)(::boost::lazy_disable_if<B,Ret>)>
{
typedef ::boost::lazy_disable_if<B,Ret> type;
};
template <bool b, typename Ret>
struct unaryfunptr_return_type<void(*)(::boost::lazy_disable_if_c<b,Ret>)>
{
typedef ::boost::lazy_disable_if_c<b,Ret> type;
};
}}} // namespace boost::parameter::aux
#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
#include <type_traits>
namespace boost { namespace parameter { namespace aux {
template <bool b, typename Ret>
struct unaryfunptr_return_type<void(*)(::std::enable_if<b,Ret>)>
{
typedef ::std::enable_if<b,Ret> type;
};
}}} // namespace boost::parameter::aux
#endif // BOOST_NO_CXX11_HDR_TYPE_TRAITS
#endif // BOOST_NO_SFINAE
// A macro that takes a parenthesized C++ type name (T) and transforms it
// into an un-parenthesized type expression equivalent to identity<T>.
#define BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(x) \
::boost::parameter::aux::unaryfunptr_return_type< void(*)x >::type
#endif // include guard

View File

@@ -0,0 +1,34 @@
// Copyright David Abrahams 2006.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_PARENTHESIZED_TYPE_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_PARENTHESIZED_TYPE_HPP
namespace boost { namespace parameter { namespace aux {
// A metafunction that transforms void(*)(T) -> T
template <typename UnaryFunctionPointer>
struct unaryfunptr_arg_type;
template <typename Arg>
struct unaryfunptr_arg_type<void(*)(Arg)>
{
typedef Arg type;
};
template <>
struct unaryfunptr_arg_type<void(*)(void)>
{
typedef void type;
};
}}} // namespace boost::parameter::aux
// A macro that takes a parenthesized C++ type name (T) and transforms it
// into an un-parenthesized type expression equivalent to T.
#define BOOST_PARAMETER_PARENTHESIZED_TYPE(x) \
::boost::parameter::aux::unaryfunptr_arg_type< void(*)x >::type
#endif // include guard

View File

@@ -0,0 +1,109 @@
// Copyright Daniel Wallin 2006.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_SPECIFICATION_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_SPECIFICATION_HPP
#include <boost/parameter/optional.hpp>
// Helper macros for BOOST_PARAMETER_SPECIFICATION_ELEM_R.
#define BOOST_PARAMETER_QUALIFIED_TAG_optional(tag) \
optional<tag
/**/
#include <boost/parameter/required.hpp>
#define BOOST_PARAMETER_QUALIFIED_TAG_required(tag) \
required<tag
/**/
#include <boost/parameter/deduced.hpp>
#define BOOST_PARAMETER_QUALIFIED_TAG_deduced_optional(tag) \
optional< ::boost::parameter::deduced<tag>
/**/
#define BOOST_PARAMETER_QUALIFIED_TAG_deduced_required(tag) \
required< ::boost::parameter::deduced<tag>
/**/
#include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp>
#include <boost/parameter/config.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/cat.hpp>
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
#include <boost/parameter/aux_/use_default.hpp>
#define BOOST_PARAMETER_SPECIFICATION_ELEM_R(r, tag_namespace, i, elem) \
BOOST_PP_COMMA_IF(i) ::boost::parameter::BOOST_PP_CAT( \
BOOST_PARAMETER_QUALIFIED_TAG_ \
, BOOST_PARAMETER_FN_ARG_QUALIFIER(elem) \
)(tag_namespace::BOOST_PARAMETER_FN_ARG_NAME(elem)) \
, ::boost::parameter::aux::use_default \
>
/**/
#else // !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
#include <boost/parameter/aux_/pp_impl/unwrap_predicate.hpp>
// Expands to each boost::parameter::parameters<> element type.
#define BOOST_PARAMETER_SPECIFICATION_ELEM_R(r, tag_namespace, i, elem) \
BOOST_PP_COMMA_IF(i) ::boost::parameter::BOOST_PP_CAT( \
BOOST_PARAMETER_QUALIFIED_TAG_ \
, BOOST_PARAMETER_FN_ARG_QUALIFIER(elem) \
)(tag_namespace::BOOST_PARAMETER_FN_ARG_NAME(elem)) \
, typename ::boost::parameter::aux::unwrap_predicate< \
void BOOST_PARAMETER_FN_ARG_PRED(elem) \
>::type \
>
/**/
#endif // Borland workarounds needed.
#include <boost/parameter/parameters.hpp>
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp>
// Expands to a boost::parameter::parameters<> specialization for the
// function named base. Used by BOOST_PARAMETER_CONSTRUCTOR_AUX and
// BOOST_PARAMETER_FUNCTION_HEAD for their respective ParameterSpec models.
#define BOOST_PARAMETER_SPECIFICATION(tag_ns, base, split_args, is_const) \
template <typename BoostParameterDummy> \
struct BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_IF( \
is_const \
, boost_param_params_const_ \
, boost_param_params_ \
) \
, __LINE__ \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
) : ::boost::parameter::parameters< \
BOOST_PP_SEQ_FOR_EACH_I( \
BOOST_PARAMETER_SPECIFICATION_ELEM_R, tag_ns, split_args \
) \
> \
{ \
}; \
typedef BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_IF( \
is_const \
, boost_param_params_const_ \
, boost_param_params_ \
) \
, __LINE__ \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
)<int>
/**/
#endif // include guard

View File

@@ -0,0 +1,71 @@
// Copyright Daniel Wallin 2006.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_SPLIT_ARGS_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_SPLIT_ARGS_HPP
#include <boost/preprocessor/tuple/elem.hpp>
// Accessor macros for the split_args tuple.
#define BOOST_PARAMETER_SPLIT_ARG_REQ_COUNT(x) BOOST_PP_TUPLE_ELEM(4, 0, x)
#define BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ(x) BOOST_PP_TUPLE_ELEM(4, 1, x)
#define BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT(x) BOOST_PP_TUPLE_ELEM(4, 2, x)
#define BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(x) BOOST_PP_TUPLE_ELEM(4, 3, x)
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/seq/push_back.hpp>
// Helper macros for BOOST_PARAMETER_FUNCTION_SPLIT_ARGS.
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_required(s_a, arg) \
( \
BOOST_PP_INC(BOOST_PARAMETER_SPLIT_ARG_REQ_COUNT(s_a)) \
, BOOST_PP_SEQ_PUSH_BACK(BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ(s_a), arg) \
, BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT(s_a) \
, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(s_a) \
)
/**/
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_deduced_required(split_args, arg) \
BOOST_PARAMETER_FUNCTION_SPLIT_ARG_required(split_args, arg)
/**/
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_optional(s_a, arg) \
( \
BOOST_PARAMETER_SPLIT_ARG_REQ_COUNT(s_a) \
, BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ(s_a) \
, BOOST_PP_INC(BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT(s_a)) \
, BOOST_PP_SEQ_PUSH_BACK(BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(s_a), arg) \
)
/**/
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_deduced_optional(split_args, arg) \
BOOST_PARAMETER_FUNCTION_SPLIT_ARG_optional(split_args, arg)
/**/
#include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp>
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG(s, split_args, arg) \
BOOST_PP_CAT( \
BOOST_PARAMETER_FUNCTION_SPLIT_ARG_ \
, BOOST_PARAMETER_FN_ARG_QUALIFIER(arg) \
)(split_args, arg)
/**/
#include <boost/preprocessor/seq/fold_left.hpp>
#include <boost/preprocessor/seq/seq.hpp>
// Expands from the flattened BOOST_PARAMETER_FUNCTION et. al. arg sequence to
// the tuple (required_count, required_args, optional_count, optional_args).
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARGS(args) \
BOOST_PP_SEQ_FOLD_LEFT( \
BOOST_PARAMETER_FUNCTION_SPLIT_ARG \
, (0, BOOST_PP_SEQ_NIL, 0, BOOST_PP_SEQ_NIL) \
, args \
)
/**/
#endif // include guard