// 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_PACK_MAKE_PARAMETER_SPEC_ITEMS_HPP #define BOOST_PARAMETER_AUX_PACK_MAKE_PARAMETER_SPEC_ITEMS_HPP namespace boost { namespace parameter { namespace aux { // This recursive metafunction forwards successive elements of // parameters::parameter_spec to make_deduced_items<>. // -- Cromwell D. Enage template struct make_deduced_list; // Helper for match_parameters_base_cond<...>, below. template struct match_parameters_base_cond_helper; // Helper metafunction for make_parameter_spec_items<...>, below. template struct make_parameter_spec_items_helper; }}} // namespace boost::parameter::aux #include namespace boost { namespace parameter { namespace aux { template struct make_parameter_spec_items_helper { typedef ::boost::parameter::void_ type; }; }}} // namespace boost::parameter::aux #include #if defined(BOOST_PARAMETER_CAN_USE_MP11) #include #else #include #include #endif namespace boost { namespace parameter { namespace aux { template struct make_deduced_list_not_empty : ::boost::parameter::aux::make_deduced_items< #if defined(BOOST_PARAMETER_CAN_USE_MP11) ::boost::mp11::mp_front #else typename ::boost::mpl::front::type #endif , ::boost::parameter::aux::make_deduced_list< #if defined(BOOST_PARAMETER_CAN_USE_MP11) ::boost::mp11::mp_pop_front #else typename ::boost::mpl::pop_front::type #endif > > { }; }}} // namespace boost::parameter::aux #if defined(BOOST_PARAMETER_CAN_USE_MP11) #include #else #include #include #include #endif namespace boost { namespace parameter { namespace aux { template struct make_deduced_list #if defined(BOOST_PARAMETER_CAN_USE_MP11) : ::boost::mp11::mp_if< ::boost::mp11::mp_empty , ::boost::mp11::mp_identity< ::boost::parameter::void_> #else : ::boost::mpl::eval_if< ::boost::mpl::empty , ::boost::mpl::identity< ::boost::parameter::void_> #endif , ::boost::parameter::aux::make_deduced_list_not_empty > { }; }}} // namespace boost::parameter::aux #if defined(BOOST_PARAMETER_CAN_USE_MP11) #include #else #include #include #include #include namespace boost { namespace parameter { namespace aux { template struct is_arg_pack_error_void : ::boost::mpl::if_< ::boost::is_same< typename ::boost::mpl::second::type , ::boost::parameter::void_ > , ::boost::mpl::true_ , ::boost::mpl::false_ >::type { }; }}} // namespace boost::parameter::aux #endif // BOOST_PARAMETER_CAN_USE_MP11 namespace boost { namespace parameter { namespace aux { // Checks if the arguments match the criteria of overload resolution. // If NamedList satisfies the PS0, PS1, ..., this is a metafunction // returning parameters. Otherwise it has no nested ::type. template #if defined(BOOST_PARAMETER_CAN_USE_MP11) using match_parameters_base_cond = ::boost::mp11::mp_if< ::boost::mp11::mp_empty , ::std::is_same< ::boost::mp11::mp_at_c , ::boost::parameter::void_ > , ::boost::parameter::aux::match_parameters_base_cond_helper< ArgumentPackAndError , SpecSeq > >; #else struct match_parameters_base_cond : ::boost::mpl::eval_if< ::boost::mpl::empty , ::boost::parameter::aux ::is_arg_pack_error_void , ::boost::parameter::aux::match_parameters_base_cond_helper< ArgumentPackAndError , SpecSeq > > { }; #endif // BOOST_PARAMETER_CAN_USE_MP11 }}} // namespace boost::parameter::aux #include namespace boost { namespace parameter { namespace aux { template struct match_parameters_base_cond_helper #if defined(BOOST_PARAMETER_CAN_USE_MP11) : ::boost::mp11::mp_if< #else : ::boost::mpl::eval_if< #endif ::boost::parameter::aux::satisfies_requirements_of< #if defined(BOOST_PARAMETER_CAN_USE_MP11) ::boost::mp11::mp_at_c , ::boost::mp11::mp_front #else typename ::boost::mpl::first::type , typename ::boost::mpl::front::type #endif > , ::boost::parameter::aux::match_parameters_base_cond< ArgumentPackAndError #if defined(BOOST_PARAMETER_CAN_USE_MP11) , ::boost::mp11::mp_pop_front #else , typename ::boost::mpl::pop_front::type #endif > #if defined(BOOST_PARAMETER_CAN_USE_MP11) , ::boost::mp11::mp_false #else , ::boost::mpl::false_ #endif > { }; // This parameters item chaining metafunction class does not require // the lengths of the SpecSeq and of Args parameter pack to match. // Used by argument_pack to build the items in the resulting arg_list. // -- Cromwell D. Enage template #if defined(BOOST_PARAMETER_CAN_USE_MP11) using make_parameter_spec_items = ::boost::mp11::mp_if< ::boost::mp11::mp_empty , ::boost::mp11::mp_identity< ::boost::parameter::void_> , ::boost::parameter::aux ::make_parameter_spec_items_helper >; #else struct make_parameter_spec_items : ::boost::mpl::eval_if< ::boost::mpl::empty , ::boost::mpl::identity< ::boost::parameter::void_> , ::boost::parameter::aux ::make_parameter_spec_items_helper > { }; #endif }}} // namespace boost::parameter::aux #include namespace boost { namespace parameter { namespace aux { template struct make_parameter_spec_items_helper : ::boost::parameter::aux::make_items< #if defined(BOOST_PARAMETER_CAN_USE_MP11) ::boost::mp11::mp_front #else typename ::boost::mpl::front::type #endif , A0 , ::boost::parameter::aux::make_parameter_spec_items< #if defined(BOOST_PARAMETER_CAN_USE_MP11) ::boost::mp11::mp_pop_front #else typename ::boost::mpl::pop_front::type #endif , Args... > > { }; }}} // namespace boost::parameter::aux #endif // include guard