File indexing completed on 2025-01-18 09:43:29
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP
0008 #define BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP
0009
0010 #include <boost/parameter/aux_/unwrap_cv_reference.hpp>
0011 #include <boost/parameter/aux_/tagged_argument.hpp>
0012 #include <boost/parameter/config.hpp>
0013
0014 #if defined(BOOST_PARAMETER_CAN_USE_MP11) && \
0015 !BOOST_WORKAROUND(BOOST_MSVC, >= 1910)
0016
0017
0018 #include <boost/mp11/integral.hpp>
0019 #include <boost/mp11/utility.hpp>
0020 #include <type_traits>
0021
0022 namespace boost { namespace parameter { namespace aux {
0023
0024 template <typename Keyword, typename Arg>
0025 struct tag_if_lvalue_reference
0026 {
0027 using type = ::boost::parameter::aux::tagged_argument_list_of_1<
0028 ::boost::parameter::aux::tagged_argument<
0029 Keyword
0030 , typename ::boost::parameter::aux
0031 ::unwrap_cv_reference<Arg>::type
0032 >
0033 >;
0034 };
0035
0036 template <typename Keyword, typename Arg>
0037 struct tag_if_scalar
0038 {
0039 using type = ::boost::parameter::aux::tagged_argument_list_of_1<
0040 ::boost::parameter::aux
0041 ::tagged_argument<Keyword,typename ::std::add_const<Arg>::type>
0042 >;
0043 };
0044
0045 template <typename Keyword, typename Arg>
0046 using tag_if_otherwise = ::boost::mp11::mp_if<
0047 ::std::is_scalar<typename ::std::remove_const<Arg>::type>
0048 , ::boost::parameter::aux::tag_if_scalar<Keyword,Arg>
0049 , ::boost::mp11::mp_identity<
0050 ::boost::parameter::aux::tagged_argument_list_of_1<
0051 ::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
0052 >
0053 >
0054 >;
0055
0056 template <typename Keyword, typename Arg>
0057 using tag = ::boost::mp11::mp_if<
0058 ::boost::mp11::mp_if<
0059 ::std::is_lvalue_reference<Arg>
0060 , ::boost::mp11::mp_true
0061 , ::boost::parameter::aux::is_cv_reference_wrapper<Arg>
0062 >
0063 , ::boost::parameter::aux::tag_if_lvalue_reference<Keyword,Arg>
0064 , ::boost::parameter::aux::tag_if_otherwise<Keyword,Arg>
0065 >;
0066 }}}
0067
0068 #elif defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
0069 #include <boost/mpl/bool.hpp>
0070 #include <boost/mpl/if.hpp>
0071 #include <boost/mpl/eval_if.hpp>
0072 #include <boost/mpl/identity.hpp>
0073 #include <boost/type_traits/add_const.hpp>
0074 #include <boost/type_traits/is_scalar.hpp>
0075 #include <boost/type_traits/is_lvalue_reference.hpp>
0076 #include <boost/type_traits/remove_const.hpp>
0077
0078 namespace boost { namespace parameter { namespace aux {
0079
0080 template <typename Keyword, typename ActualArg>
0081 struct tag
0082 {
0083 typedef typename ::boost::parameter::aux
0084 ::unwrap_cv_reference<ActualArg>::type Arg;
0085 typedef typename ::boost::add_const<Arg>::type ConstArg;
0086 typedef typename ::boost::remove_const<Arg>::type MutArg;
0087 typedef typename ::boost::mpl::eval_if<
0088 typename ::boost::mpl::if_<
0089 ::boost::is_lvalue_reference<ActualArg>
0090 , ::boost::mpl::true_
0091 , ::boost::parameter::aux::is_cv_reference_wrapper<ActualArg>
0092 >::type
0093 , ::boost::mpl::identity<
0094 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0095 ::boost::parameter::aux::tagged_argument_list_of_1<
0096 #endif
0097 ::boost::parameter::aux::tagged_argument<Keyword,Arg>
0098 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0099 >
0100 #endif
0101 >
0102 , ::boost::mpl::if_<
0103 ::boost::is_scalar<MutArg>
0104 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0105 , ::boost::parameter::aux::tagged_argument_list_of_1<
0106 ::boost::parameter::aux::tagged_argument<Keyword,ConstArg>
0107 >
0108 , ::boost::parameter::aux::tagged_argument_list_of_1<
0109 ::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
0110 >
0111 #else
0112 , ::boost::parameter::aux::tagged_argument<Keyword,ConstArg>
0113 , ::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
0114 #endif
0115 >
0116 >::type type;
0117 };
0118 }}}
0119
0120 #else
0121
0122 namespace boost { namespace parameter { namespace aux {
0123
0124 template <
0125 typename Keyword
0126 , typename Arg
0127 #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
0128 , typename = typename ::boost::parameter::aux
0129 ::is_cv_reference_wrapper<Arg>::type
0130 #endif
0131 >
0132 struct tag
0133 {
0134 typedef ::boost::parameter::aux::tagged_argument<
0135 Keyword
0136 , typename ::boost::parameter::aux::unwrap_cv_reference<Arg>::type
0137 > type;
0138 };
0139 }}}
0140
0141 #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
0142 #include <boost/mpl/bool.hpp>
0143 #include <boost/type_traits/remove_reference.hpp>
0144
0145 namespace boost { namespace parameter { namespace aux {
0146
0147 template <typename Keyword, typename Arg>
0148 struct tag<Keyword,Arg,::boost::mpl::false_>
0149 {
0150 typedef ::boost::parameter::aux::tagged_argument<
0151 Keyword
0152 , typename ::boost::remove_reference<Arg>::type
0153 > type;
0154 };
0155 }}}
0156
0157 #endif
0158 #endif
0159 #endif
0160