Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85517 - trunk/boost/geometry/index/detail/rtree
From: adam.wulkiewicz_at_[hidden]
Date: 2013-08-29 18:59:02


Author: awulkiew
Date: 2013-08-29 18:59:02 EDT (Thu, 29 Aug 2013)
New Revision: 85517
URL: http://svn.boost.org/trac/boost/changeset/85517

Log:
[geometry][index] type-erased query iterators move semantics implemented using Boost.Move replaced by c++11 rval refs if supported. Error in move assign fixed.

Text files modified:
   trunk/boost/geometry/index/detail/rtree/query_iterators.hpp | 20 ++++++++++++++++++--
   1 files changed, 18 insertions(+), 2 deletions(-)

Modified: trunk/boost/geometry/index/detail/rtree/query_iterators.hpp
==============================================================================
--- trunk/boost/geometry/index/detail/rtree/query_iterators.hpp Thu Aug 29 12:44:18 2013 (r85516)
+++ trunk/boost/geometry/index/detail/rtree/query_iterators.hpp 2013-08-29 18:59:02 EDT (Thu, 29 Aug 2013) (r85517)
@@ -12,7 +12,7 @@
 #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_QUERY_ITERATORS_HPP
 
 //#define BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_TYPE_ERASURE
-#define BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_MOVE
+//#define BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_MOVE
 
 namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree { namespace iterators {
 
@@ -284,6 +284,22 @@
         m_ptr.reset(o.m_ptr.get() ? o.m_ptr->clone() : 0);
         return *this;
     }
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ query_iterator(query_iterator && o)
+ : m_ptr(o.m_ptr.get())
+ {
+ o.m_ptr.release();
+ }
+ query_iterator & operator=(query_iterator && o)
+ {
+ if ( this != boost::addressof(o) )
+ {
+ m_ptr.reset(o.m_ptr.get());
+ o.m_ptr.release();
+ }
+ return *this;
+ }
+#endif
 #else // !BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_MOVE
 private:
     BOOST_COPYABLE_AND_MOVABLE(query_iterator)
@@ -303,7 +319,7 @@
         if ( this != boost::addressof(o) )
         {
             m_ptr.reset(o.m_ptr.get());
- o.m_ptr.get().release();
+ o.m_ptr.release();
         }
         return *this;
     }


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