Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2008-05-20 11:13:57


Author: danieljames
Date: 2008-05-20 11:13:57 EDT (Tue, 20 May 2008)
New Revision: 45573
URL: http://svn.boost.org/trac/boost/changeset/45573

Log:
Fix for older versions of the Borland C++ compiler which create the default
'operator=' even when an 'operator=' which takes its argument by value has been
defined. This causes assignments to be ambiguous. To work around this, I'm
removing the definitions on those compilers - breaking move assignment, but
allowing other assignments to work.

I'm using 0x0593 because that's the earliest compiler that I've seen do the
right thing, but it might also work on earlier 5.9.x versions.

Refs #1923.

Text files modified:
   trunk/boost/unordered_map.hpp | 4 ++++
   trunk/boost/unordered_set.hpp | 4 ++++
   2 files changed, 8 insertions(+), 0 deletions(-)

Modified: trunk/boost/unordered_map.hpp
==============================================================================
--- trunk/boost/unordered_map.hpp (original)
+++ trunk/boost/unordered_map.hpp 2008-05-20 11:13:57 EDT (Tue, 20 May 2008)
@@ -126,12 +126,14 @@
         {
         }
 
+#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0593)
         unordered_map& operator=(unordered_map x)
         {
             base.move(x.base);
             return *this;
         }
 #endif
+#endif
 
     private:
 
@@ -509,12 +511,14 @@
         {
         }
 
+#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0593)
         unordered_multimap& operator=(unordered_multimap x)
         {
             base.move(x.base);
             return *this;
         }
 #endif
+#endif
 
 
     private:

Modified: trunk/boost/unordered_set.hpp
==============================================================================
--- trunk/boost/unordered_set.hpp (original)
+++ trunk/boost/unordered_set.hpp 2008-05-20 11:13:57 EDT (Tue, 20 May 2008)
@@ -123,12 +123,14 @@
         {
         }
 
+#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0593)
         unordered_set& operator=(unordered_set x)
         {
             base.move(x.base);
             return *this;
         }
 #endif
+#endif
 
     private:
 
@@ -478,12 +480,14 @@
         {
         }
 
+#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0593)
         unordered_multiset& operator=(unordered_multiset x)
         {
             base.move(x.base);
             return *this;
         }
 #endif
+#endif
 
     private:
 


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