Ticket #2704: boost_locks.patch
File boost_locks.patch, 1.9 KB (added by , 14 years ago) |
---|
-
boost/thread/locks.hpp
namespace boost 36 36 true_type dummy[2]; 37 37 }; 38 38 39 template<size_t> struct sfinae_type { }; 40 39 41 template<typename U> 40 static true_type has_member(U*,void (U::*dummy)()=&U::lock );42 static true_type has_member(U*,void (U::*dummy)()=&U::lock,sfinae_type<sizeof(&U::unlock)>* = NULL); 41 43 static false_type has_member(void*); 42 44 43 45 BOOST_STATIC_CONSTANT(bool, value=sizeof(has_member_lock<T>::has_member((T*)NULL))==sizeof(true_type)); … … namespace boost 52 54 true_type dummy[2]; 53 55 }; 54 56 57 template<size_t> struct sfinae_type { }; 58 55 59 template<typename U> 56 static true_type has_member(U*,void (U::*dummy)()=&U::unlock );60 static true_type has_member(U*,void (U::*dummy)()=&U::unlock,sfinae_type<sizeof(&U::unlock)>* = NULL); 57 61 static false_type has_member(void*); 58 62 59 63 BOOST_STATIC_CONSTANT(bool, value=sizeof(has_member_unlock<T>::has_member((T*)NULL))==sizeof(true_type)); … … namespace boost 68 72 true_type dummy[2]; 69 73 }; 70 74 75 template<size_t> struct sfinae_type { }; 76 71 77 template<typename U> 72 static true_type has_member(U*, bool (U::*dummy)()=&U::try_lock);78 static true_type has_member(U*,sfinae_type<sizeof(&U::try_lock)>* = NULL,sfinae_type<sizeof(&U::try_lock)>* = NULL); 73 79 static false_type has_member(void*); 74 80 75 81 BOOST_STATIC_CONSTANT(bool, value=sizeof(has_member_try_lock<T>::has_member((T*)NULL))==sizeof(true_type));