Update of /cvsroot/boost-sandbox/boost-sandbox/boost/thread_safe_signals
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30407/thread_safe_signals
Modified Files:
track.hpp
Log Message:
Added implicit conversion to reference type to boost::tracked
Index: track.hpp
===================================================================
RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/thread_safe_signals/track.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- track.hpp 15 Feb 2007 19:26:36 -0000 1.5
+++ track.hpp 20 Feb 2007 01:19:25 -0000 1.6
@@ -24,7 +24,6 @@
namespace boost {
namespace signalslib {
// The actual wrapper for tracked shared_ptr-referenced objects.
- // (This probably needs a full smart pointer interface)
template<class T>
class tracked : public weak_ptr<T>
{
@@ -47,6 +46,14 @@
{
return shared_ptr<const T>(*this);
}
+ operator T& ()
+ {
+ return *shared_ptr<T>(*this).get();
+ }
+ operator const T& ()
+ {
+ return *shared_ptr<const T>(*this).get();
+ }
operator shared_ptr<void> () const
{
return shared_ptr<void>(*this);
|