File indexing completed on 2025-01-30 09:35:27
0001
0002
0003
0004
0005 #ifndef INDIRECT_TRAITS_DWA2002131_HPP
0006 # define INDIRECT_TRAITS_DWA2002131_HPP
0007 # include <boost/type_traits/integral_constant.hpp>
0008 # include <boost/type_traits/is_function.hpp>
0009 # include <boost/type_traits/is_reference.hpp>
0010 # include <boost/type_traits/is_pointer.hpp>
0011 # include <boost/type_traits/is_class.hpp>
0012 # include <boost/type_traits/is_const.hpp>
0013 # include <boost/type_traits/is_volatile.hpp>
0014 # include <boost/type_traits/is_member_function_pointer.hpp>
0015 # include <boost/type_traits/is_member_pointer.hpp>
0016 # include <boost/type_traits/remove_cv.hpp>
0017 # include <boost/type_traits/remove_reference.hpp>
0018 # include <boost/type_traits/remove_pointer.hpp>
0019
0020 # include <boost/detail/workaround.hpp>
0021 # include <boost/detail/select_type.hpp>
0022
0023
0024 namespace boost { namespace detail {
0025
0026 namespace indirect_traits {
0027
0028 template <class T>
0029 struct is_reference_to_const : boost::false_type
0030 {
0031 };
0032
0033 template <class T>
0034 struct is_reference_to_const<T const&> : boost::true_type
0035 {
0036 };
0037
0038 # if defined(BOOST_MSVC) && _MSC_FULL_VER <= 13102140
0039 template<class T>
0040 struct is_reference_to_const<T const volatile&> : boost::true_type
0041 {
0042 };
0043 # endif
0044
0045 template <class T>
0046 struct is_reference_to_function : boost::false_type
0047 {
0048 };
0049
0050 template <class T>
0051 struct is_reference_to_function<T&> : is_function<T>
0052 {
0053 };
0054
0055 template <class T>
0056 struct is_pointer_to_function : boost::false_type
0057 {
0058 };
0059
0060
0061
0062 template <class T>
0063 struct is_pointer_to_function<T*> : is_function<T>
0064 {
0065 };
0066
0067 template <class T>
0068 struct is_reference_to_member_function_pointer_impl : boost::false_type
0069 {
0070 };
0071
0072 template <class T>
0073 struct is_reference_to_member_function_pointer_impl<T&>
0074 : is_member_function_pointer<typename remove_cv<T>::type>
0075 {
0076 };
0077
0078
0079 template <class T>
0080 struct is_reference_to_member_function_pointer
0081 : is_reference_to_member_function_pointer_impl<T>
0082 {
0083 };
0084
0085 template <class T>
0086 struct is_reference_to_function_pointer_aux
0087 : boost::integral_constant<bool,
0088 is_reference<T>::value &&
0089 is_pointer_to_function<
0090 typename remove_cv<
0091 typename remove_reference<T>::type
0092 >::type
0093 >::value
0094 >
0095 {
0096
0097 };
0098
0099 template <class T>
0100 struct is_reference_to_function_pointer
0101 : boost::detail::if_true<
0102 is_reference_to_function<T>::value
0103 >::template then<
0104 boost::false_type
0105 , is_reference_to_function_pointer_aux<T>
0106 >::type
0107 {
0108 };
0109
0110 template <class T>
0111 struct is_reference_to_non_const
0112 : boost::integral_constant<bool,
0113 is_reference<T>::value &&
0114 !is_reference_to_const<T>::value
0115 >
0116 {
0117 };
0118
0119 template <class T>
0120 struct is_reference_to_volatile : boost::false_type
0121 {
0122 };
0123
0124 template <class T>
0125 struct is_reference_to_volatile<T volatile&> : boost::true_type
0126 {
0127 };
0128
0129 # if defined(BOOST_MSVC) && _MSC_FULL_VER <= 13102140
0130 template <class T>
0131 struct is_reference_to_volatile<T const volatile&> : boost::true_type
0132 {
0133 };
0134 # endif
0135
0136
0137 template <class T>
0138 struct is_reference_to_pointer : boost::false_type
0139 {
0140 };
0141
0142 template <class T>
0143 struct is_reference_to_pointer<T*&> : boost::true_type
0144 {
0145 };
0146
0147 template <class T>
0148 struct is_reference_to_pointer<T* const&> : boost::true_type
0149 {
0150 };
0151
0152 template <class T>
0153 struct is_reference_to_pointer<T* volatile&> : boost::true_type
0154 {
0155 };
0156
0157 template <class T>
0158 struct is_reference_to_pointer<T* const volatile&> : boost::true_type
0159 {
0160 };
0161
0162 template <class T>
0163 struct is_reference_to_class
0164 : boost::integral_constant<bool,
0165 is_reference<T>::value &&
0166 is_class<
0167 typename remove_cv<
0168 typename remove_reference<T>::type
0169 >::type
0170 >::value
0171 >
0172 {
0173 };
0174
0175 template <class T>
0176 struct is_pointer_to_class
0177 : boost::integral_constant<bool,
0178 is_pointer<T>::value &&
0179 is_class<
0180 typename remove_cv<
0181 typename remove_pointer<T>::type
0182 >::type
0183 >::value
0184 >
0185 {
0186 };
0187
0188
0189 }
0190
0191 using namespace indirect_traits;
0192
0193 }}
0194
0195 #endif