File indexing completed on 2025-01-18 09:30:41
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef BOOST_DETAIL_CALL_TRAITS_HPP
0019 #define BOOST_DETAIL_CALL_TRAITS_HPP
0020
0021 #ifndef BOOST_CONFIG_HPP
0022 #include <boost/config.hpp>
0023 #endif
0024 #include <cstddef>
0025
0026 #include <boost/type_traits/is_arithmetic.hpp>
0027 #include <boost/type_traits/is_enum.hpp>
0028 #include <boost/type_traits/is_pointer.hpp>
0029 #include <boost/detail/workaround.hpp>
0030
0031 namespace boost{
0032
0033 namespace detail{
0034
0035 template <typename T, bool small_>
0036 struct ct_imp2
0037 {
0038 typedef const T& param_type;
0039 };
0040
0041 template <typename T>
0042 struct ct_imp2<T, true>
0043 {
0044 typedef const T param_type;
0045 };
0046
0047 template <typename T, bool isp, bool b1, bool b2>
0048 struct ct_imp
0049 {
0050 typedef const T& param_type;
0051 };
0052
0053 template <typename T, bool isp, bool b2>
0054 struct ct_imp<T, isp, true, b2>
0055 {
0056 typedef typename ct_imp2<T, sizeof(T) <= sizeof(void*)>::param_type param_type;
0057 };
0058
0059 template <typename T, bool isp, bool b1>
0060 struct ct_imp<T, isp, b1, true>
0061 {
0062 typedef typename ct_imp2<T, sizeof(T) <= sizeof(void*)>::param_type param_type;
0063 };
0064
0065 template <typename T, bool b1, bool b2>
0066 struct ct_imp<T, true, b1, b2>
0067 {
0068 typedef const T param_type;
0069 };
0070
0071 }
0072
0073 template <typename T>
0074 struct call_traits
0075 {
0076 public:
0077 typedef T value_type;
0078 typedef T& reference;
0079 typedef const T& const_reference;
0080
0081
0082
0083
0084
0085
0086 typedef typename boost::detail::ct_imp<
0087 T,
0088 ::boost::is_pointer<T>::value,
0089 ::boost::is_arithmetic<T>::value,
0090 ::boost::is_enum<T>::value
0091 >::param_type param_type;
0092 };
0093
0094 template <typename T>
0095 struct call_traits<T&>
0096 {
0097 typedef T& value_type;
0098 typedef T& reference;
0099 typedef const T& const_reference;
0100 typedef T& param_type;
0101 };
0102
0103 #if BOOST_WORKAROUND( BOOST_BORLANDC, < 0x5A0 )
0104
0105
0106
0107
0108 template <typename T>
0109 struct call_traits<T&const>
0110 {
0111 typedef T& value_type;
0112 typedef T& reference;
0113 typedef const T& const_reference;
0114 typedef T& param_type;
0115 };
0116 template <typename T>
0117 struct call_traits<T&volatile>
0118 {
0119 typedef T& value_type;
0120 typedef T& reference;
0121 typedef const T& const_reference;
0122 typedef T& param_type;
0123 };
0124 template <typename T>
0125 struct call_traits<T&const volatile>
0126 {
0127 typedef T& value_type;
0128 typedef T& reference;
0129 typedef const T& const_reference;
0130 typedef T& param_type;
0131 };
0132
0133 template <typename T>
0134 struct call_traits< T * >
0135 {
0136 typedef T * value_type;
0137 typedef T * & reference;
0138 typedef T * const & const_reference;
0139 typedef T * const param_type;
0140 };
0141 #endif
0142 #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
0143 template <typename T, std::size_t N>
0144 struct call_traits<T [N]>
0145 {
0146 private:
0147 typedef T array_type[N];
0148 public:
0149
0150 typedef const T* value_type;
0151 typedef array_type& reference;
0152 typedef const array_type& const_reference;
0153 typedef const T* const param_type;
0154 };
0155
0156 template <typename T, std::size_t N>
0157 struct call_traits<const T [N]>
0158 {
0159 private:
0160 typedef const T array_type[N];
0161 public:
0162
0163 typedef const T* value_type;
0164 typedef array_type& reference;
0165 typedef const array_type& const_reference;
0166 typedef const T* const param_type;
0167 };
0168 #endif
0169
0170 }
0171
0172 #endif