Ticket #7033: memory_util.patch
File memory_util.patch, 1.7 KB (added by , 10 years ago) |
---|
-
C:\Users\luke\Desktop\memory_util.hpp
old new 179 179 //struct type_rebind_mode 180 180 /////////////////////////// 181 181 template <typename Ptr, typename T> 182 182 struct type_has_rebind 183 183 { 184 184 template <typename X> 185 #if (!defined __SUNPRO_CC) 185 186 static char test(int, typename X::template rebind<T>*); 187 #else 188 static char test(int, typename X::rebind<T>*); 189 #endif 186 190 187 191 template <typename X> 188 192 static int test(boost::intrusive::detail::LowPriorityConversion<int>, void*); 189 193 190 194 static const bool value = (1 == sizeof(test<Ptr>(0, 0))); 191 195 }; 192 196 193 197 template <typename Ptr, typename T> 194 198 struct type_has_rebind_other 195 199 { 196 200 template <typename X> 201 #if (!defined __SUNPRO_CC) 197 202 static char test(int, typename X::template rebind<T>::other*); 203 #else 204 static char test(int, typename X::rebind<T>::other*); 205 #endif 198 206 199 207 template <typename X> 200 208 static int test(boost::intrusive::detail::LowPriorityConversion<int>, void*); 201 209 202 210 static const bool value = (1 == sizeof(test<Ptr>(0, 0))); 203 211 }; 204 212 205 213 template <typename Ptr, typename T> 206 214 struct type_rebind_mode 207 215 { 208 template <typename X>209 static char test(int, typename X::template rebind<T>::other*);210 211 template <typename X>212 static int test(boost::intrusive::detail::LowPriorityConversion<int>, void*);213 214 216 static const unsigned int rebind = (unsigned int)type_has_rebind<Ptr, T>::value; 215 217 static const unsigned int rebind_other = (unsigned int)type_has_rebind_other<Ptr, T>::value; 216 218 static const unsigned int mode = rebind + rebind*rebind_other; 217 219 }; 218 220 219 221 ////////////////////////