Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69469 - branches/release/boost/unordered
From: dnljms_at_[hidden]
Date: 2011-03-02 03:47:53


Author: danieljames
Date: 2011-03-02 03:47:34 EST (Wed, 02 Mar 2011)
New Revision: 69469
URL: http://svn.boost.org/trac/boost/changeset/69469

Log:
Add copy constructors and assignment operators when using rvalue references. Fixes #5119.

Properties modified:
   branches/release/boost/unordered/ (props changed)
Text files modified:
   branches/release/boost/unordered/unordered_map.hpp | 22 ++++++++++++++++++++++
   branches/release/boost/unordered/unordered_set.hpp | 22 ++++++++++++++++++++++
   2 files changed, 44 insertions(+), 0 deletions(-)

Modified: branches/release/boost/unordered/unordered_map.hpp
==============================================================================
--- branches/release/boost/unordered/unordered_map.hpp (original)
+++ branches/release/boost/unordered/unordered_map.hpp 2011-03-02 03:47:34 EST (Wed, 02 Mar 2011)
@@ -160,6 +160,11 @@
         ~unordered_map() {}
 
 #if !defined(BOOST_NO_RVALUE_REFERENCES)
+ unordered_map(unordered_map const& other)
+ : table_(other.table_)
+ {
+ }
+
         unordered_map(unordered_map&& other)
           : table_(other.table_, boost::unordered_detail::move_tag())
         {
@@ -170,6 +175,12 @@
         {
         }
 
+ unordered_map& operator=(unordered_map const& x)
+ {
+ table_ = x.table_;
+ return *this;
+ }
+
         unordered_map& operator=(unordered_map&& x)
         {
             table_.move(x.table_);
@@ -705,6 +716,11 @@
         ~unordered_multimap() {}
 
 #if !defined(BOOST_NO_RVALUE_REFERENCES)
+ unordered_multimap(unordered_multimap const& other)
+ : table_(other.table_)
+ {
+ }
+
         unordered_multimap(unordered_multimap&& other)
           : table_(other.table_, boost::unordered_detail::move_tag())
         {
@@ -715,6 +731,12 @@
         {
         }
 
+ unordered_multimap& operator=(unordered_multimap const& x)
+ {
+ table_ = x.table_;
+ return *this;
+ }
+
         unordered_multimap& operator=(unordered_multimap&& x)
         {
             table_.move(x.table_);

Modified: branches/release/boost/unordered/unordered_set.hpp
==============================================================================
--- branches/release/boost/unordered/unordered_set.hpp (original)
+++ branches/release/boost/unordered/unordered_set.hpp 2011-03-02 03:47:34 EST (Wed, 02 Mar 2011)
@@ -154,6 +154,11 @@
         ~unordered_set() {}
 
 #if !defined(BOOST_NO_RVALUE_REFERENCES)
+ unordered_set(unordered_set const& other)
+ : table_(other.table_)
+ {
+ }
+
         unordered_set(unordered_set&& other)
           : table_(other.table_, boost::unordered_detail::move_tag())
         {
@@ -164,6 +169,12 @@
         {
         }
 
+ unordered_set& operator=(unordered_set const& x)
+ {
+ table_ = x.table_;
+ return *this;
+ }
+
         unordered_set& operator=(unordered_set&& x)
         {
             table_.move(x.table_);
@@ -651,6 +662,11 @@
         ~unordered_multiset() {}
 
 #if !defined(BOOST_NO_RVALUE_REFERENCES)
+ unordered_multiset(unordered_multiset const& other)
+ : table_(other.table_)
+ {
+ }
+
         unordered_multiset(unordered_multiset&& other)
           : table_(other.table_, boost::unordered_detail::move_tag())
         {
@@ -661,6 +677,12 @@
         {
         }
 
+ unordered_multiset& operator=(unordered_multiset const& x)
+ {
+ table_ = x.table_;
+ return *this;
+ }
+
         unordered_multiset& operator=(unordered_multiset&& x)
         {
             table_.move(x.table_);


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