00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef BOOST_DETAIL_CALL_TRAITS_HPP
00020 #define BOOST_DETAIL_CALL_TRAITS_HPP
00021
00022 #ifndef BOOST_CONFIG_HPP
00023 #include <sysc/packages/boost/config.hpp>
00024 #endif
00025
00026 #ifndef BOOST_ARITHMETIC_TYPE_TRAITS_HPP
00027 #include <sysc/packages/boost/type_traits/arithmetic_traits.hpp>
00028 #endif
00029 #ifndef BOOST_COMPOSITE_TYPE_TRAITS_HPP
00030 #include <sysc/packages/boost/type_traits/composite_traits.hpp>
00031 #endif
00032
00033 namespace boost{
00034
00035 namespace detail{
00036
00037 template <typename T, bool small_>
00038 struct ct_imp2
00039 {
00040 typedef const T& param_type;
00041 };
00042
00043 template <typename T>
00044 struct ct_imp2<T, true>
00045 {
00046 typedef const T param_type;
00047 };
00048
00049 template <typename T, bool isp, bool b1>
00050 struct ct_imp
00051 {
00052 typedef const T& param_type;
00053 };
00054
00055 template <typename T, bool isp>
00056 struct ct_imp<T, isp, true>
00057 {
00058 typedef typename ct_imp2<T, sizeof(T) <= sizeof(void*)>::param_type param_type;
00059 };
00060
00061 template <typename T, bool b1>
00062 struct ct_imp<T, true, b1>
00063 {
00064 typedef T const param_type;
00065 };
00066
00067 }
00068
00069 template <typename T>
00070 struct call_traits
00071 {
00072 public:
00073 typedef T value_type;
00074 typedef T& reference;
00075 typedef const T& const_reference;
00076
00077
00078
00079
00080
00081
00082 typedef typename detail::ct_imp<
00083 T,
00084 ::boost::is_pointer<T>::value,
00085 ::boost::is_arithmetic<T>::value
00086 >::param_type param_type;
00087 };
00088
00089 template <typename T>
00090 struct call_traits<T&>
00091 {
00092 typedef T& value_type;
00093 typedef T& reference;
00094 typedef const T& const_reference;
00095 typedef T& param_type;
00096 };
00097
00098 #if defined(__BORLANDC__) && (__BORLANDC__ <= 0x560)
00099
00100
00101
00102
00103 template <typename T>
00104 struct call_traits<T&const>
00105 {
00106 typedef T& value_type;
00107 typedef T& reference;
00108 typedef const T& const_reference;
00109 typedef T& param_type;
00110 };
00111 template <typename T>
00112 struct call_traits<T&volatile>
00113 {
00114 typedef T& value_type;
00115 typedef T& reference;
00116 typedef const T& const_reference;
00117 typedef T& param_type;
00118 };
00119 template <typename T>
00120 struct call_traits<T&const volatile>
00121 {
00122 typedef T& value_type;
00123 typedef T& reference;
00124 typedef const T& const_reference;
00125 typedef T& param_type;
00126 };
00127 #endif
00128 #ifndef __SUNPRO_CC
00129 template <typename T, std::size_t N>
00130 struct call_traits<T [N]>
00131 {
00132 private:
00133 typedef T array_type[N];
00134 public:
00135
00136 typedef const T* value_type;
00137 typedef array_type& reference;
00138 typedef const array_type& const_reference;
00139 typedef const T* const param_type;
00140 };
00141
00142 template <typename T, std::size_t N>
00143 struct call_traits<const T [N]>
00144 {
00145 private:
00146 typedef const T array_type[N];
00147 public:
00148
00149 typedef const T* value_type;
00150 typedef array_type& reference;
00151 typedef const array_type& const_reference;
00152 typedef const T* const param_type;
00153 };
00154 #endif
00155
00156 }
00157
00158 #endif // BOOST_DETAIL_CALL_TRAITS_HPP