Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52815 - sandbox/boost0x/boost/smart_ptr
From: tobi_at_[hidden]
Date: 2009-05-06 20:49:32


Author: tobias.loew
Date: 2009-05-06 20:49:30 EDT (Wed, 06 May 2009)
New Revision: 52815
URL: http://svn.boost.org/trac/boost/changeset/52815

Log:
- reintroduced -nonconverting move ctor and nonconverting move assignment operator for efficiency reasons
Text files modified:
   sandbox/boost0x/boost/smart_ptr/weak_ptr.hpp | 16 +++++++++++++++-
   1 files changed, 15 insertions(+), 1 deletions(-)

Modified: sandbox/boost0x/boost/smart_ptr/weak_ptr.hpp
==============================================================================
--- sandbox/boost0x/boost/smart_ptr/weak_ptr.hpp (original)
+++ sandbox/boost0x/boost/smart_ptr/weak_ptr.hpp 2009-05-06 20:49:30 EDT (Wed, 06 May 2009)
@@ -88,9 +88,23 @@
 #endif
     : px(r.lock().get()), pn(std::move(r.pn)) // never throws
     {
- r.px = 0;
+ //not necesary to set r.px = 0 as r.pn.pi_ == 0
     }
 
+ // for better efficiency in the T == Y case
+ weak_ptr( weak_ptr && r ): px( r.px ), pn(std::move(r.pn)) // never throws
+ {
+ //not necesary to set r.px = 0 as r.pn.pi_ == 0
+ }
+
+ // for better efficiency in the T == Y case
+ weak_ptr & operator=( weak_ptr && r ) // never throws
+ {
+ this_type( static_cast< weak_ptr && >( r ) ).swap( *this );
+ return *this;
+ }
+
+
 #endif
 
     template<class Y>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk