// Copyright David Abrahams 2005. // 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_TAG_DWA2005610_HPP #define BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP #include #include #include #if defined(BOOST_PARAMETER_CAN_USE_MP11) && \ !BOOST_WORKAROUND(BOOST_MSVC, >= 1910) // MSVC-14.1+ assigns rvalue references to tagged_argument instances // instead of tagged_argument_rref instances with this code. #include #include #include namespace boost { namespace parameter { namespace aux { template struct tag_if_lvalue_reference { using type = ::boost::parameter::aux::tagged_argument_list_of_1< ::boost::parameter::aux::tagged_argument< Keyword , typename ::boost::parameter::aux ::unwrap_cv_reference::type > >; }; template struct tag_if_scalar { using type = ::boost::parameter::aux::tagged_argument_list_of_1< ::boost::parameter::aux ::tagged_argument::type> >; }; template using tag_if_otherwise = ::boost::mp11::mp_if< ::std::is_scalar::type> , ::boost::parameter::aux::tag_if_scalar , ::boost::mp11::mp_identity< ::boost::parameter::aux::tagged_argument_list_of_1< ::boost::parameter::aux::tagged_argument_rref > > >; template using tag = ::boost::mp11::mp_if< ::boost::mp11::mp_if< ::std::is_lvalue_reference , ::boost::mp11::mp_true , ::boost::parameter::aux::is_cv_reference_wrapper > , ::boost::parameter::aux::tag_if_lvalue_reference , ::boost::parameter::aux::tag_if_otherwise >; }}} // namespace boost::parameter::aux_ #elif defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING) #include #include #include #include #include #include #include #include namespace boost { namespace parameter { namespace aux { template struct tag { typedef typename ::boost::parameter::aux ::unwrap_cv_reference::type Arg; typedef typename ::boost::add_const::type ConstArg; typedef typename ::boost::remove_const::type MutArg; typedef typename ::boost::mpl::eval_if< typename ::boost::mpl::if_< ::boost::is_lvalue_reference , ::boost::mpl::true_ , ::boost::parameter::aux::is_cv_reference_wrapper >::type , ::boost::mpl::identity< #if defined(BOOST_PARAMETER_CAN_USE_MP11) ::boost::parameter::aux::tagged_argument_list_of_1< #endif ::boost::parameter::aux::tagged_argument #if defined(BOOST_PARAMETER_CAN_USE_MP11) > #endif > , ::boost::mpl::if_< ::boost::is_scalar #if defined(BOOST_PARAMETER_CAN_USE_MP11) , ::boost::parameter::aux::tagged_argument_list_of_1< ::boost::parameter::aux::tagged_argument > , ::boost::parameter::aux::tagged_argument_list_of_1< ::boost::parameter::aux::tagged_argument_rref > #else , ::boost::parameter::aux::tagged_argument , ::boost::parameter::aux::tagged_argument_rref #endif > >::type type; }; }}} // namespace boost::parameter::aux_ #else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING) namespace boost { namespace parameter { namespace aux { template < typename Keyword , typename Arg #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) , typename = typename ::boost::parameter::aux ::is_cv_reference_wrapper::type #endif > struct tag { typedef ::boost::parameter::aux::tagged_argument< Keyword , typename ::boost::parameter::aux::unwrap_cv_reference::type > type; }; }}} // namespace boost::parameter::aux_ #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) #include #include namespace boost { namespace parameter { namespace aux { template struct tag { typedef ::boost::parameter::aux::tagged_argument< Keyword , typename ::boost::remove_reference::type > type; }; }}} // namespace boost::parameter::aux_ #endif // Borland workarounds needed. #endif // MP11 or perfect forwarding support #endif // include guard