Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71618 - sandbox/block_ptr/boost
From: phil_at_[hidden]
Date: 2011-04-30 03:17:32


Author: pbouchard
Date: 2011-04-30 03:17:27 EDT (Sat, 30 Apr 2011)
New Revision: 71618
URL: http://svn.boost.org/trac/boost/changeset/71618

Log:
* Adding move semantics
Text files modified:
   sandbox/block_ptr/boost/block_ptr.hpp | 32 ++++++++++++++++++++++++++++++++
   1 files changed, 32 insertions(+), 0 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-04-30 03:17:27 EDT (Sat, 30 Apr 2011)
@@ -391,6 +391,38 @@
                                 release(true);
         }
 
+#if defined(BOOST_HAS_RVALUE_REFS)
+ block_ptr(block_ptr && p)
+ {
+ po_ = std::move(p.po_);
+ ps_ = std::move(p.ps_);
+ }
+
+ template<class Y>
+ block_ptr(block_ptr<Y> && p): base(0), ps_(0)
+ {
+ po_ = std::move(p.po_);
+ ps_ = std::move(p.ps_);
+ }
+
+ block_ptr & operator = (block_ptr && p)
+ {
+ po_ = std::move(p.po_);
+ ps_ = std::move(p.ps_);
+
+ return *this;
+ }
+
+ template<class Y>
+ block_ptr & operator = (block_ptr<Y> && p)
+ {
+ po_ = std::move(p.po_);
+ ps_ = std::move(p.ps_);
+
+ return *this;
+ }
+#endif
+
     private:
                 /**
                         Release of the pointee object with or without destroying the entire @c block_header it belongs to.


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