Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72383 - sandbox/block_ptr/boost
From: phil_at_[hidden]
Date: 2011-06-03 23:24:26


Author: pbouchard
Date: 2011-06-03 23:24:24 EDT (Fri, 03 Jun 2011)
New Revision: 72383
URL: http://svn.boost.org/trac/boost/changeset/72383

Log:
* Activated r-value semantics
Text files modified:
   sandbox/block_ptr/boost/block_ptr.hpp | 19 ++++++++++---------
   1 files changed, 10 insertions(+), 9 deletions(-)

Modified: sandbox/block_ptr/boost/block_ptr.hpp
==============================================================================
--- sandbox/block_ptr/boost/block_ptr.hpp (original)
+++ sandbox/block_ptr/boost/block_ptr.hpp 2011-06-03 23:24:24 EDT (Fri, 03 Jun 2011)
@@ -469,22 +469,24 @@
                                 }
             }
         }
-/*
- public:
+
 #if defined(BOOST_HAS_RVALUE_REFS)
- block_ptr(block_ptr<T> && p): base(std::move(p.po_)), ps_(std::move(p.ps_))
+ public:
+ block_ptr(block_ptr<T> && p): base(p.po_), ps_(p.ps_)
             {
+ p.po_ = 0;
             }
 
             template<class Y>
- block_ptr(block_ptr<Y> && p): base(std::move(p.po_)), ps_(std::move(p.ps_))
+ block_ptr(block_ptr<Y> && p): base(p.po_), ps_(p.ps_)
                     {
+ p.po_ = 0;
                     }
 
             block_ptr<T> & operator = (block_ptr<T> && p)
             {
- po_ = std::move(p.po_);
- ps_ = std::move(p.ps_);
+ std::swap(po_, p.po_);
+ std::swap(ps_, p.ps_);
                        
                 return *this;
             }
@@ -492,13 +494,12 @@
             template<class Y>
                     block_ptr & operator = (block_ptr<Y> && p)
                     {
- po_ = std::move(p.po_);
- ps_ = std::move(p.ps_);
+ std::swap(po_, p.po_);
+ std::swap(ps_, p.ps_);
                         
                         return *this;
                     }
 #endif
-*/
     };
 
 template <typename V>


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