// 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 ACTIV_BOOST_PARAMETER_COMPOSE_HPP #define ACTIV_BOOST_PARAMETER_COMPOSE_HPP #include namespace Boost { namespace parameter { inline ACTIV_BOOST_CONSTEXPR ::Boost::parameter::aux::empty_arg_list compose() { return ::Boost::parameter::aux::empty_arg_list(); } }} // namespace Boost::parameter #include #if defined(ACTIV_BOOST_PARAMETER_HAS_PERFECT_FORWARDING) namespace Boost { namespace parameter { namespace aux { #if defined(ACTIV_BOOST_PARAMETER_CAN_USE_MP11) template struct compose_arg_list { using type = ::Boost::parameter::aux::flat_like_arg_list< ::Boost::parameter::aux::flat_like_arg_tuple< typename TaggedArgs::base_type::key_type , typename TaggedArgs::base_type >... >; }; #else // !defined(ACTIV_BOOST_PARAMETER_CAN_USE_MP11) template struct compose_arg_list; template struct compose_arg_list { typedef ::Boost::parameter::aux::arg_list type; }; template struct compose_arg_list { typedef ::Boost::parameter::aux::arg_list< TaggedArg0 , typename ::Boost::parameter::aux ::compose_arg_list::type > type; }; #endif // ACTIV_BOOST_PARAMETER_CAN_USE_MP11 }}} // namespace Boost::parameter::aux #include #include namespace Boost { namespace parameter { namespace result_of { template struct compose : ::Boost::lazy_enable_if< ::Boost::parameter::are_tagged_arguments , ::Boost::parameter::aux::compose_arg_list > { }; template <> struct compose<> { typedef ::Boost::parameter::aux::empty_arg_list type; }; }}} // namespace Boost::parameter::result_of namespace Boost { namespace parameter { template inline ACTIV_BOOST_CONSTEXPR typename ::Boost::parameter::result_of ::compose::type compose(TaggedArg0 const& arg0, TaggedArgs const&... args) { return typename ::Boost::parameter::aux ::compose_arg_list::type( ::Boost::parameter::aux::value_type_is_not_void() , arg0 , args... ); } }} // namespace Boost::parameter #else // !defined(ACTIV_BOOST_PARAMETER_HAS_PERFECT_FORWARDING) #define ACTIV_BOOST_PARAMETER_compose_arg_list_type_suffix(z, n, suffix) suffix #include #define ACTIV_BOOST_PARAMETER_compose_arg_list_type_prefix(z, n, prefix) \ ::Boost::parameter::aux::arg_list #include #include #define ACTIV_BOOST_PARAMETER_compose_arg_list_type(z, n, prefix) \ ACTIV_BOOST_PP_CAT(ACTIV_BOOST_PP_ENUM_, z)( \ n, ACTIV_BOOST_PARAMETER_compose_arg_list_type_prefix, prefix \ ) ACTIV_BOOST_PP_CAT(ACTIV_BOOST_PP_REPEAT_, z)( \ n, ACTIV_BOOST_PARAMETER_compose_arg_list_type_suffix, > \ ) /**/ #include #include #include #include #include #include #if defined(ACTIV_BOOST_NO_SFINAE) #define ACTIV_BOOST_PARAMETER_compose_arg_list_function_overload(z, n, prefix) \ template \ inline ACTIV_BOOST_CONSTEXPR \ ACTIV_BOOST_PARAMETER_compose_arg_list_type(z, n, prefix) \ compose(ACTIV_BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, prefix, const& a)) \ { \ return ACTIV_BOOST_PARAMETER_compose_arg_list_type(z, n, prefix)( \ ACTIV_BOOST_PP_ENUM_PARAMS_Z(z, n, a) \ ACTIV_BOOST_PP_ENUM_TRAILING_PARAMS_Z( \ z \ , ACTIV_BOOST_PP_SUB(ACTIV_BOOST_PARAMETER_COMPOSE_MAX_ARITY, n) \ , ::Boost::parameter::aux::void_reference() ACTIV_BOOST_PP_INTERCEPT \ ) \ ); \ } /**/ #else // !defined(ACTIV_BOOST_NO_SFINAE) #include #include namespace Boost { namespace parameter { namespace result_of { template < ACTIV_BOOST_PP_ENUM_BINARY_PARAMS( ACTIV_BOOST_PP_INC(ACTIV_BOOST_PARAMETER_COMPOSE_MAX_ARITY) , typename TaggedArg , = void ACTIV_BOOST_PP_INTERCEPT ) > struct compose; template <> struct compose<> { typedef ::Boost::parameter::aux::empty_arg_list type; }; }}} // namespace Boost::parameter::result_of #define ACTIV_BOOST_PARAMETER_compose_arg_list_function_overload(z, n, prefix) \ namespace Boost { namespace parameter { namespace result_of { \ template \ struct compose \ : ::Boost::enable_if< \ ::Boost::parameter \ ::are_tagged_arguments \ , ACTIV_BOOST_PARAMETER_compose_arg_list_type(z, n, prefix) \ > \ { \ }; \ }}} \ namespace Boost { namespace parameter { \ template \ inline ACTIV_BOOST_CONSTEXPR typename ::Boost::parameter::result_of \ ::compose::type \ compose(ACTIV_BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, prefix, const& a)) \ { \ return ACTIV_BOOST_PARAMETER_compose_arg_list_type(z, n, prefix)( \ ACTIV_BOOST_PP_ENUM_PARAMS_Z(z, n, a) \ ACTIV_BOOST_PP_ENUM_TRAILING_PARAMS_Z( \ z \ , ACTIV_BOOST_PP_SUB(ACTIV_BOOST_PARAMETER_COMPOSE_MAX_ARITY, n) \ , ::Boost::parameter::aux::void_reference() ACTIV_BOOST_PP_INTERCEPT \ ) \ ); \ } \ }} /**/ #endif // ACTIV_BOOST_NO_SFINAE #include ACTIV_BOOST_PP_REPEAT_FROM_TO( 1 , ACTIV_BOOST_PP_INC(ACTIV_BOOST_PARAMETER_COMPOSE_MAX_ARITY) , ACTIV_BOOST_PARAMETER_compose_arg_list_function_overload , TaggedArg ) #undef ACTIV_BOOST_PARAMETER_compose_arg_list_function_overload #undef ACTIV_BOOST_PARAMETER_compose_arg_list_type #undef ACTIV_BOOST_PARAMETER_compose_arg_list_type_prefix #undef ACTIV_BOOST_PARAMETER_compose_arg_list_type_suffix #endif // ACTIV_BOOST_PARAMETER_HAS_PERFECT_FORWARDING #endif // include guard