Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73593 - in trunk/boost/unordered: . detail
From: dnljms_at_[hidden]
Date: 2011-08-07 06:22:44


Author: danieljames
Date: 2011-08-07 06:22:41 EDT (Sun, 07 Aug 2011)
New Revision: 73593
URL: http://svn.boost.org/trac/boost/changeset/73593

Log:
Unordered: Don't use BOOST_RV_REF with Sun compilers.
Text files modified:
   trunk/boost/unordered/detail/util.hpp | 6 ++++
   trunk/boost/unordered/unordered_map.hpp | 51 ++++++++++++++++++++++++---------------
   trunk/boost/unordered/unordered_set.hpp | 50 ++++++++++++++++++++++++--------------
   3 files changed, 68 insertions(+), 39 deletions(-)

Modified: trunk/boost/unordered/detail/util.hpp
==============================================================================
--- trunk/boost/unordered/detail/util.hpp (original)
+++ trunk/boost/unordered/detail/util.hpp 2011-08-07 06:22:41 EDT (Sun, 07 Aug 2011)
@@ -62,6 +62,12 @@
 #define BOOST_UNORDERED_EMPLACE_LIMIT 10
 #endif
 
+#if defined(__SUNPRO_CC)
+#define BOOST_UNORDERED_USE_RV_REF 0
+#else
+#define BOOST_UNORDERED_USE_RV_REF 1
+#endif
+
 #if !defined(BOOST_UNORDERED_STD_FORWARD_MOVE)
 
 #include <boost/preprocessor/repetition/enum_params.hpp>

Modified: trunk/boost/unordered/unordered_map.hpp
==============================================================================
--- trunk/boost/unordered/unordered_map.hpp (original)
+++ trunk/boost/unordered/unordered_map.hpp 2011-08-07 06:22:41 EDT (Sun, 07 Aug 2011)
@@ -133,6 +133,9 @@
             return *this;
         }
 
+ unordered_map(unordered_map const&);
+
+#if BOOST_UNORDERED_USE_RV_REF
         unordered_map& operator=(
                 BOOST_RV_REF(unordered_map) x)
         {
@@ -140,13 +143,11 @@
             return *this;
         }
 
-
- unordered_map(unordered_map const&);
-
         unordered_map(BOOST_RV_REF(unordered_map) other)
             : table_(other.table_, ::boost::unordered::detail::move_tag())
         {
         }
+#endif
 
 #if !defined(BOOST_NO_RVALUE_REFERENCES)
         unordered_map(unordered_map&&, allocator_type const&);
@@ -259,9 +260,11 @@
 #endif
 
         std::pair<iterator, bool> insert(value_type const&);
- std::pair<iterator, bool> insert(BOOST_RV_REF(value_type));
         iterator insert(const_iterator, value_type const&);
+#if BOOST_UNORDERED_USE_RV_REF
+ std::pair<iterator, bool> insert(BOOST_RV_REF(value_type));
         iterator insert(const_iterator, BOOST_RV_REF(value_type));
+#endif
         template <class InputIt> void insert(InputIt, InputIt);
 
 #if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
@@ -481,6 +484,9 @@
             return *this;
         }
 
+ unordered_multimap(unordered_multimap const&);
+
+#if BOOST_UNORDERED_USE_RV_REF
         unordered_multimap& operator=(
                 BOOST_RV_REF(unordered_multimap) x)
         {
@@ -488,12 +494,11 @@
             return *this;
         }
 
- unordered_multimap(unordered_multimap const&);
-
         unordered_multimap(BOOST_RV_REF(unordered_multimap) other)
             : table_(other.table_, ::boost::unordered::detail::move_tag())
         {
         }
+#endif
 
 #if !defined(BOOST_NO_RVALUE_REFERENCES)
         unordered_multimap(unordered_multimap&&, allocator_type const&);
@@ -606,9 +611,11 @@
 #endif
 
         iterator insert(value_type const&);
- iterator insert(BOOST_RV_REF(value_type));
         iterator insert(const_iterator, value_type const&);
+#if BOOST_UNORDERED_USE_RV_REF
+ iterator insert(BOOST_RV_REF(value_type));
         iterator insert(const_iterator, BOOST_RV_REF(value_type));
+#endif
         template <class InputIt> void insert(InputIt, InputIt);
 
 #if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
@@ -929,14 +936,6 @@
     }
 
     template <class K, class T, class H, class P, class A>
- std::pair<BOOST_DEDUCED_TYPENAME unordered_map<K,T,H,P,A>::iterator, bool>
- unordered_map<K,T,H,P,A>::insert(BOOST_RV_REF(value_type) obj)
- {
- return BOOST_UNORDERED_PAIR_CAST(iterator, bool,
- table_.emplace(boost::move(obj)));
- }
-
- template <class K, class T, class H, class P, class A>
     BOOST_DEDUCED_TYPENAME unordered_map<K,T,H,P,A>::iterator
         unordered_map<K,T,H,P,A>::insert(const_iterator,
                 value_type const& obj)
@@ -944,6 +943,15 @@
         return iterator(table_.emplace(obj).first);
     }
 
+#if BOOST_UNORDERED_USE_RV_REF
+ template <class K, class T, class H, class P, class A>
+ std::pair<BOOST_DEDUCED_TYPENAME unordered_map<K,T,H,P,A>::iterator, bool>
+ unordered_map<K,T,H,P,A>::insert(BOOST_RV_REF(value_type) obj)
+ {
+ return BOOST_UNORDERED_PAIR_CAST(iterator, bool,
+ table_.emplace(boost::move(obj)));
+ }
+
     template <class K, class T, class H, class P, class A>
     BOOST_DEDUCED_TYPENAME unordered_map<K,T,H,P,A>::iterator
         unordered_map<K,T,H,P,A>::insert(const_iterator,
@@ -951,6 +959,7 @@
     {
         return iterator(table_.emplace(boost::move(obj)).first);
     }
+#endif
 
     template <class K, class T, class H, class P, class A>
     template <class InputIt>
@@ -1364,17 +1373,18 @@
 
     template <class K, class T, class H, class P, class A>
     BOOST_DEDUCED_TYPENAME unordered_multimap<K,T,H,P,A>::iterator
- unordered_multimap<K,T,H,P,A>::insert(BOOST_RV_REF(value_type) obj)
+ unordered_multimap<K,T,H,P,A>::insert(
+ const_iterator, value_type const& obj)
     {
- return iterator(table_.emplace(boost::move(obj)));
+ return iterator(table_.emplace(obj));
     }
 
+#if BOOST_UNORDERED_USE_RV_REF
     template <class K, class T, class H, class P, class A>
     BOOST_DEDUCED_TYPENAME unordered_multimap<K,T,H,P,A>::iterator
- unordered_multimap<K,T,H,P,A>::insert(
- const_iterator, value_type const& obj)
+ unordered_multimap<K,T,H,P,A>::insert(BOOST_RV_REF(value_type) obj)
     {
- return iterator(table_.emplace(obj));
+ return iterator(table_.emplace(boost::move(obj)));
     }
 
     template <class K, class T, class H, class P, class A>
@@ -1384,6 +1394,7 @@
     {
         return iterator(table_.emplace(boost::move(obj)));
     }
+#endif
 
     template <class K, class T, class H, class P, class A>
     template <class InputIt>

Modified: trunk/boost/unordered/unordered_set.hpp
==============================================================================
--- trunk/boost/unordered/unordered_set.hpp (original)
+++ trunk/boost/unordered/unordered_set.hpp 2011-08-07 06:22:41 EDT (Sun, 07 Aug 2011)
@@ -131,6 +131,9 @@
             return *this;
         }
 
+ unordered_set(unordered_set const&);
+
+#if BOOST_UNORDERED_USE_RV_REF
         unordered_set& operator=(
                 BOOST_RV_REF(unordered_set) x)
         {
@@ -138,12 +141,11 @@
             return *this;
         }
 
- unordered_set(unordered_set const&);
-
         unordered_set(BOOST_RV_REF(unordered_set) other)
             : table_(other.table_, ::boost::unordered::detail::move_tag())
         {
         }
+#endif
 
 #if !defined(BOOST_NO_RVALUE_REFERENCES)
         unordered_set(unordered_set&&, allocator_type const&);
@@ -254,9 +256,11 @@
 #endif
 
         std::pair<iterator, bool> insert(value_type const&);
- std::pair<iterator, bool> insert(BOOST_RV_REF(value_type));
         iterator insert(const_iterator, value_type const&);
+#if BOOST_UNORDERED_USE_RV_REF
+ std::pair<iterator, bool> insert(BOOST_RV_REF(value_type));
         iterator insert(const_iterator, BOOST_RV_REF(value_type));
+#endif
         template <class InputIt> void insert(InputIt, InputIt);
 
 #if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
@@ -458,6 +462,9 @@
             return *this;
         }
 
+ unordered_multiset(unordered_multiset const&);
+
+#if BOOST_UNORDERED_USE_RV_REF
         unordered_multiset& operator=(
                 BOOST_RV_REF(unordered_multiset) x)
         {
@@ -465,12 +472,11 @@
             return *this;
         }
 
- unordered_multiset(unordered_multiset const&);
-
         unordered_multiset(BOOST_RV_REF(unordered_multiset) other)
             : table_(other.table_, ::boost::unordered::detail::move_tag())
         {
         }
+#endif
 
 #if !defined(BOOST_NO_RVALUE_REFERENCES)
         unordered_multiset(unordered_multiset&&, allocator_type const&);
@@ -581,9 +587,11 @@
 #endif
 
         iterator insert(value_type const&);
- iterator insert(BOOST_RV_REF(value_type));
         iterator insert(const_iterator, value_type const&);
+#if BOOST_UNORDERED_USE_RV_REF
+ iterator insert(BOOST_RV_REF(value_type));
         iterator insert(const_iterator, BOOST_RV_REF(value_type));
+#endif
         template <class InputIt>
         void insert(InputIt, InputIt);
 
@@ -892,14 +900,6 @@
     }
 
     template <class T, class H, class P, class A>
- std::pair<BOOST_DEDUCED_TYPENAME unordered_set<T,H,P,A>::iterator, bool>
- unordered_set<T,H,P,A>::insert(BOOST_RV_REF(value_type) obj)
- {
- return BOOST_UNORDERED_PAIR_CAST(iterator, bool,
- table_.emplace(boost::move(obj)));
- }
-
- template <class T, class H, class P, class A>
     BOOST_DEDUCED_TYPENAME unordered_set<T,H,P,A>::iterator
         unordered_set<T,H,P,A>::insert(const_iterator,
                 value_type const& obj)
@@ -907,6 +907,15 @@
         return iterator(table_.emplace(obj).first);
     }
 
+#if BOOST_UNORDERED_USE_RV_REF
+ template <class T, class H, class P, class A>
+ std::pair<BOOST_DEDUCED_TYPENAME unordered_set<T,H,P,A>::iterator, bool>
+ unordered_set<T,H,P,A>::insert(BOOST_RV_REF(value_type) obj)
+ {
+ return BOOST_UNORDERED_PAIR_CAST(iterator, bool,
+ table_.emplace(boost::move(obj)));
+ }
+
     template <class T, class H, class P, class A>
     BOOST_DEDUCED_TYPENAME unordered_set<T,H,P,A>::iterator
         unordered_set<T,H,P,A>::insert(const_iterator,
@@ -914,6 +923,7 @@
     {
         return iterator(table_.emplace(boost::move(obj)).first);
     }
+#endif
 
     template <class T, class H, class P, class A>
     template <class InputIt>
@@ -1273,17 +1283,18 @@
 
     template <class T, class H, class P, class A>
     BOOST_DEDUCED_TYPENAME unordered_multiset<T,H,P,A>::iterator
- unordered_multiset<T,H,P,A>::insert(BOOST_RV_REF(value_type) obj)
+ unordered_multiset<T,H,P,A>::insert(const_iterator,
+ value_type const& obj)
     {
- return iterator(table_.emplace(boost::move(obj)));
+ return iterator(table_.emplace(obj));
     }
 
+#if BOOST_UNORDERED_USE_RV_REF
     template <class T, class H, class P, class A>
     BOOST_DEDUCED_TYPENAME unordered_multiset<T,H,P,A>::iterator
- unordered_multiset<T,H,P,A>::insert(const_iterator,
- value_type const& obj)
+ unordered_multiset<T,H,P,A>::insert(BOOST_RV_REF(value_type) obj)
     {
- return iterator(table_.emplace(obj));
+ return iterator(table_.emplace(boost::move(obj)));
     }
 
     template <class T, class H, class P, class A>
@@ -1293,6 +1304,7 @@
     {
         return iterator(table_.emplace(boost::move(obj)));
     }
+#endif
 
     template <class T, class H, class P, class A>
     template <class InputIt>


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