// Copyright David Abrahams 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 ACTIV_BOOST_PARAMETER_BINDING_DWA200558_HPP #define ACTIV_BOOST_PARAMETER_BINDING_DWA200558_HPP #include #include #if defined(ACTIV_BOOST_PARAMETER_CAN_USE_MP11) #include #include #include #include #else #include #include #include #include #include #include #include #endif namespace Boost { namespace parameter { // A metafunction that, given an argument pack, returns the reference type // of the parameter identified by the given keyword. If no such parameter // has been specified, returns Default template struct binding0 { #if defined(ACTIV_BOOST_PARAMETER_CAN_USE_MP11) using type = ::Boost::mp11::mp_apply_q< typename Parameters::binding , ::Boost::mp11::mp_list >; static_assert( ::Boost::mp11::mp_if< ::std::is_same , ::Boost::mp11::mp_if< ::std::is_same , ::Boost::mp11::mp_false , ::Boost::mp11::mp_true > , ::Boost::mp11::mp_true >::value , "required parameters must not result in void_ type" ); #else // !defined(ACTIV_BOOST_PARAMETER_CAN_USE_MP11) typedef typename ::Boost::mpl::apply_wrap3< typename Parameters::binding , Keyword , Default , ::Boost::mpl::true_ >::type type; ACTIV_BOOST_MPL_ASSERT(( typename ::Boost::mpl::eval_if< ::Boost::is_same , ::Boost::mpl::if_< ::Boost::is_same , ::Boost::mpl::false_ , ::Boost::mpl::true_ > , ::Boost::mpl::true_ >::type )); #endif // ACTIV_BOOST_PARAMETER_CAN_USE_MP11 }; #if defined(ACTIV_BOOST_PARAMETER_CAN_USE_MP11) template struct binding1 { using type = ::Boost::mp11::mp_apply_q< Placeholder , ::Boost::mp11::mp_list >; static_assert( ::Boost::mp11::mp_if< ::std::is_same , ::Boost::mp11::mp_if< ::std::is_same , ::Boost::mp11::mp_false , ::Boost::mp11::mp_true > , ::Boost::mp11::mp_true >::value , "required parameters must not result in void_ type" ); }; #endif // ACTIV_BOOST_PARAMETER_CAN_USE_MP11 }} // namespace Boost::parameter #include namespace Boost { namespace parameter { template < typename Parameters , typename Keyword , typename Default = ::Boost::parameter::void_ > struct binding #if !defined(ACTIV_BOOST_PARAMETER_CAN_USE_MP11) : ::Boost::mpl::eval_if< ::Boost::parameter::aux::is_mpl_placeholder , ::Boost::mpl::identity , ::Boost::parameter::binding0 > #endif { #if defined(ACTIV_BOOST_PARAMETER_CAN_USE_MP11) using type = typename ::Boost::mp11::mp_if< ::Boost::parameter::aux::is_mpl_placeholder , ::Boost::mp11::mp_identity , ::Boost::mp11::mp_if< ::Boost::parameter::aux::is_mp11_placeholder , ::Boost::parameter::binding1 , ::Boost::parameter::binding0 > >::type; #endif }; }} // namespace Boost::parameter #include namespace Boost { namespace parameter { // A metafunction that, given an argument pack, returns the reference type // of the parameter identified by the given keyword. If no such parameter // has been specified, returns the type returned by invoking DefaultFn template struct lazy_binding { #if defined(ACTIV_BOOST_PARAMETER_CAN_USE_MP11) using type = ::Boost::mp11::mp_apply_q< typename Parameters::binding , ::Boost::mp11::mp_list< Keyword , typename ::Boost::parameter::aux::result_of0::type , ::Boost::mp11::mp_true > >; #else typedef typename ::Boost::mpl::apply_wrap3< typename Parameters::binding , Keyword , typename ::Boost::parameter::aux::result_of0::type , ::Boost::mpl::true_ >::type type; #endif // ACTIV_BOOST_PARAMETER_CAN_USE_MP11 }; }} // namespace Boost::parameter #endif // include guard