Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2008-04-06 17:46:05


Author: danieljames
Date: 2008-04-06 17:46:04 EDT (Sun, 06 Apr 2008)
New Revision: 44085
URL: http://svn.boost.org/trac/boost/changeset/44085

Log:
Use normal references for the move members, reset the source buckets_ pointer to stop the buckets getting deleted, and remove a superflous pointer check.
Text files modified:
   branches/unordered/trunk/boost/unordered/detail/hash_table_impl.hpp | 7 ++++---
   1 files changed, 4 insertions(+), 3 deletions(-)

Modified: branches/unordered/trunk/boost/unordered/detail/hash_table_impl.hpp
==============================================================================
--- branches/unordered/trunk/boost/unordered/detail/hash_table_impl.hpp (original)
+++ branches/unordered/trunk/boost/unordered/detail/hash_table_impl.hpp 2008-04-06 17:46:04 EDT (Sun, 06 Apr 2008)
@@ -368,7 +368,7 @@
             // no throw
             ~BOOST_UNORDERED_TABLE_DATA()
             {
- if(buckets_) delete_buckets();
+ delete_buckets();
             }
 
             void create_buckets() {
@@ -427,10 +427,11 @@
             }
 
             // no throw
- void move(BOOST_UNORDERED_TABLE_DATA&& other)
+ void move(BOOST_UNORDERED_TABLE_DATA& other)
             {
                 delete_buckets();
                 buckets_ = other.buckets_;
+ unordered_detail::reset(other.buckets_);
                 bucket_count_ = other.bucket_count_;
                 cached_begin_bucket_ = other.cached_begin_bucket_;
                 size_ = other.size_;
@@ -1262,7 +1263,7 @@
             // Can throw if hash or predicate object's copy constructor throws
             // or if allocators are unequal.
 
- void move(BOOST_UNORDERED_TABLE&& x)
+ void move(BOOST_UNORDERED_TABLE& x)
             {
                 // This only effects the function objects that aren't in use
                 // so it is strongly exception safe, via. double buffering.


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