From 18e46ae62407d396d1137971cbdc25f9a0593c31 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Tue, 20 May 2008 15:13:57 +0000 Subject: [PATCH] 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. [SVN r45573] --- include/boost/unordered_map.hpp | 4 ++++ include/boost/unordered_set.hpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/boost/unordered_map.hpp b/include/boost/unordered_map.hpp index 22119804..c172881f 100644 --- a/include/boost/unordered_map.hpp +++ b/include/boost/unordered_map.hpp @@ -126,11 +126,13 @@ namespace boost { } +#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0593) unordered_map& operator=(unordered_map x) { base.move(x.base); return *this; } +#endif #endif private: @@ -509,12 +511,14 @@ namespace boost { } +#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0593) unordered_multimap& operator=(unordered_multimap x) { base.move(x.base); return *this; } #endif +#endif private: diff --git a/include/boost/unordered_set.hpp b/include/boost/unordered_set.hpp index b3c645ff..5acdf55b 100644 --- a/include/boost/unordered_set.hpp +++ b/include/boost/unordered_set.hpp @@ -123,11 +123,13 @@ namespace boost { } +#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0593) unordered_set& operator=(unordered_set x) { base.move(x.base); return *this; } +#endif #endif private: @@ -478,11 +480,13 @@ namespace boost { } +#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0593) unordered_multiset& operator=(unordered_multiset x) { base.move(x.base); return *this; } +#endif #endif private: