|
From: Frank M. H. <fm...@us...> - 2007-02-22 20:47:26
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/thread_safe_signals In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29265/thread_safe_signals Modified Files: track.hpp Log Message: Handle reference-wrapped values gracefully for the sake of the 2 parameter version of track(). Index: track.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/thread_safe_signals/track.hpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- track.hpp 22 Feb 2007 20:23:48 -0000 1.11 +++ track.hpp 22 Feb 2007 20:47:20 -0000 1.12 @@ -12,6 +12,7 @@ #ifndef BOOST_SIGNALS_TRACK_HEADER #define BOOST_SIGNALS_TRACK_HEADER +#include <boost/ref.hpp> #include <boost/smart_ptr.hpp> #ifdef BOOST_HAS_ABI_HEADERS @@ -25,17 +26,17 @@ class tracked { public: - typedef T value_type; + typedef typename unwrap_reference<T>::type value_type; tracked(const shared_ptr<void>& tracked_ptr, const T &value): _value(value), _tracked_ptr(tracked_ptr) {} // implicit conversions so tracked objects can be bound with bind - operator T& () + operator value_type & () { return _value; } - operator const T& () const + operator const value_type & () const { return _value; } |