File indexing completed on 2025-01-18 09:43:30
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_PARAMETER_AUX_UNWRAP_CV_REFERENCE_HPP
0008 #define BOOST_PARAMETER_AUX_UNWRAP_CV_REFERENCE_HPP
0009
0010 namespace boost {
0011
0012 template <typename T>
0013 class reference_wrapper;
0014 }
0015
0016 #include <boost/parameter/aux_/yesno.hpp>
0017
0018 namespace boost { namespace parameter { namespace aux {
0019
0020
0021
0022
0023
0024
0025
0026 template <typename U>
0027 ::boost::parameter::aux::yes_tag
0028 is_cv_reference_wrapper_check(
0029 ::boost::reference_wrapper<U> const volatile*
0030 );
0031
0032 ::boost::parameter::aux::no_tag is_cv_reference_wrapper_check(...);
0033 }}}
0034
0035 #include <boost/parameter/config.hpp>
0036
0037 #if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
0038 #include <functional>
0039
0040 namespace boost { namespace parameter { namespace aux {
0041
0042
0043 template <typename U>
0044 ::boost::parameter::aux::yes_tag
0045 is_cv_reference_wrapper_check(
0046 ::std::reference_wrapper<U> const volatile*
0047 );
0048 }}}
0049 #endif
0050
0051 #include <boost/parameter/aux_/preprocessor/nullptr.hpp>
0052
0053 #if defined(BOOST_PARAMETER_CAN_USE_MP11) && !( \
0054 BOOST_WORKAROUND(BOOST_MSVC, >= 1900) && \
0055 BOOST_WORKAROUND(BOOST_MSVC, < 1910) \
0056 )
0057 #include <boost/mp11/integral.hpp>
0058 #include <boost/mp11/utility.hpp>
0059 #include <type_traits>
0060 #else
0061 #include <boost/mpl/bool.hpp>
0062 #include <boost/type_traits/remove_reference.hpp>
0063 #if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564)) && \
0064 !BOOST_WORKAROUND(BOOST_GCC, < 40000)
0065 #include <boost/mpl/eval_if.hpp>
0066 #endif
0067 #endif
0068
0069 namespace boost { namespace parameter { namespace aux {
0070
0071 #if defined(BOOST_PARAMETER_CAN_USE_MP11) && !( \
0072 BOOST_WORKAROUND(BOOST_MSVC, >= 1900) && \
0073 BOOST_WORKAROUND(BOOST_MSVC, < 1910) \
0074 )
0075
0076
0077 template <typename T>
0078 using is_cv_reference_wrapper = ::boost::mp11::mp_bool<
0079 sizeof(
0080 ::boost::parameter::aux::is_cv_reference_wrapper_check(
0081 static_cast<
0082 typename ::std::remove_reference<T>::type*
0083 >(BOOST_PARAMETER_AUX_PP_NULLPTR)
0084 )
0085 ) == sizeof(::boost::parameter::aux::yes_tag)
0086 >;
0087
0088
0089
0090 template <typename T>
0091 using unwrap_cv_reference_impl = typename ::std::remove_reference<T>::type;
0092
0093
0094
0095
0096 template <typename T>
0097 using unwrap_cv_reference = ::boost::mp11::mp_eval_if<
0098 ::boost::parameter::aux::is_cv_reference_wrapper<T>
0099 , ::boost::parameter::aux::unwrap_cv_reference_impl<T>
0100 , ::std::remove_reference
0101 , T
0102 >;
0103 #else
0104
0105
0106 template <typename T>
0107 struct is_cv_reference_wrapper
0108 {
0109 BOOST_STATIC_CONSTANT(
0110 bool, value = (
0111 sizeof(
0112 ::boost::parameter::aux::is_cv_reference_wrapper_check(
0113 static_cast<
0114 typename ::boost::remove_reference<T>::type*
0115 >(BOOST_PARAMETER_AUX_PP_NULLPTR)
0116 )
0117 ) == sizeof(::boost::parameter::aux::yes_tag)
0118 )
0119 );
0120
0121 typedef boost::mpl::bool_<
0122 #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
0123 is_cv_reference_wrapper::
0124 #endif
0125 value> type;
0126 };
0127
0128 #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564)) || \
0129 BOOST_WORKAROUND(BOOST_GCC, < 40000)
0130 template <
0131 typename T
0132 , typename = typename ::boost::parameter::aux
0133 ::is_cv_reference_wrapper<T>::type
0134 >
0135 struct unwrap_cv_reference : ::boost::remove_reference<T>
0136 {
0137 };
0138
0139 template <typename T>
0140 struct unwrap_cv_reference<T const,::boost::mpl::false_>
0141 {
0142 typedef T const type;
0143 };
0144
0145 template <typename T>
0146 struct unwrap_cv_reference<T,::boost::mpl::true_> : T
0147 {
0148 };
0149 #else
0150
0151
0152 template <typename T>
0153 struct unwrap_cv_reference_impl : ::boost::remove_reference<T>::type
0154 {
0155 };
0156
0157
0158
0159
0160 template <typename T>
0161 struct unwrap_cv_reference
0162 : ::boost::mpl::eval_if<
0163 ::boost::parameter::aux::is_cv_reference_wrapper<T>
0164 , ::boost::parameter::aux::unwrap_cv_reference_impl<T>
0165 , ::boost::remove_reference<T>
0166 >
0167 {
0168 };
0169 #endif
0170 #endif
0171 }}}
0172
0173 #endif
0174