Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56363 - in trunk/boost/unordered: . detail
From: daniel_james_at_[hidden]
Date: 2009-09-22 18:39:18


Author: danieljames
Date: 2009-09-22 18:39:17 EDT (Tue, 22 Sep 2009)
New Revision: 56363
URL: http://svn.boost.org/trac/boost/changeset/56363

Log:
Remove the emplace_hint implementation for unique containers as it isn't really used and seems to be causing sun 5.7 problems.
Text files modified:
   trunk/boost/unordered/detail/fwd.hpp | 17 -------------
   trunk/boost/unordered/detail/unique.hpp | 46 ---------------------------------------
   trunk/boost/unordered/unordered_map.hpp | 17 ++++++--------
   trunk/boost/unordered/unordered_set.hpp | 18 ++++++--------
   4 files changed, 17 insertions(+), 81 deletions(-)

Modified: trunk/boost/unordered/detail/fwd.hpp
==============================================================================
--- trunk/boost/unordered/detail/fwd.hpp (original)
+++ trunk/boost/unordered/detail/fwd.hpp 2009-09-22 18:39:17 EDT (Tue, 22 Sep 2009)
@@ -629,30 +629,18 @@
         template<class... Args>
         emplace_return emplace(Args&&... args);
         template<class... Args>
- iterator_base emplace_hint(iterator_base const&, Args&&... args);
- template<class... Args>
         emplace_return emplace_impl(key_type const& k, Args&&... args);
         template<class... Args>
         emplace_return emplace_impl(no_key, Args&&... args);
         template<class... Args>
         emplace_return emplace_empty_impl(Args&&... args);
 #else
- template <class Arg0>
- emplace_return emplace(Arg0 const& arg0);
- template <class Arg0>
- iterator_base emplace_hint(iterator_base const&, Arg0 const& arg0);
 
 #define BOOST_UNORDERED_INSERT_IMPL(z, n, _) \
         template <BOOST_UNORDERED_TEMPLATE_ARGS(z, n)> \
         emplace_return emplace( \
             BOOST_UNORDERED_FUNCTION_PARAMS(z, n)); \
         template <BOOST_UNORDERED_TEMPLATE_ARGS(z, n)> \
- iterator_base emplace_hint(iterator_base const& it, \
- BOOST_UNORDERED_FUNCTION_PARAMS(z, n)); \
- BOOST_UNORDERED_INSERT_IMPL2(z, n, _)
-
-#define BOOST_UNORDERED_INSERT_IMPL2(z, n, _) \
- template <BOOST_UNORDERED_TEMPLATE_ARGS(z, n)> \
         emplace_return emplace_impl(key_type const& k, \
            BOOST_UNORDERED_FUNCTION_PARAMS(z, n)); \
         template <BOOST_UNORDERED_TEMPLATE_ARGS(z, n)> \
@@ -662,13 +650,10 @@
         emplace_return emplace_empty_impl( \
            BOOST_UNORDERED_FUNCTION_PARAMS(z, n));
 
- BOOST_UNORDERED_INSERT_IMPL2(1, 1, _)
-
- BOOST_PP_REPEAT_FROM_TO(2, BOOST_UNORDERED_EMPLACE_LIMIT,
+ BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT,
             BOOST_UNORDERED_INSERT_IMPL, _)
 
 #undef BOOST_UNORDERED_INSERT_IMPL
-#undef BOOST_UNORDERED_INSERT_IMPL2
 
 #endif
 

Modified: trunk/boost/unordered/detail/unique.hpp
==============================================================================
--- trunk/boost/unordered/detail/unique.hpp (original)
+++ trunk/boost/unordered/detail/unique.hpp 2009-09-22 18:39:17 EDT (Tue, 22 Sep 2009)
@@ -272,25 +272,6 @@
             emplace_empty_impl(std::forward<Args>(args)...);
     }
 
- // Insert (unique keys)
- // (I'm using an overloaded emplace for both 'insert' and 'emplace')
- // I'm just ignoring hints here for now.
-
- // if hash function throws, basic exception safety
- // strong otherwise
- template <class H, class P, class A, class K>
- template<class... Args>
- BOOST_DEDUCED_TYPENAME hash_unique_table<H, P, A, K>::iterator_base
- hash_unique_table<H, P, A, K>::emplace_hint(iterator_base const&,
- Args&&... args)
- {
- return this->size_ ?
- emplace_impl(
- extractor::extract(std::forward<Args>(args)...),
- std::forward<Args>(args)...).first :
- emplace_empty_impl(std::forward<Args>(args)...).first;
- }
-
 #else
 
     template <class H, class P, class A, class K>
@@ -303,17 +284,6 @@
             emplace_empty_impl(arg0);
     }
 
- template <class H, class P, class A, class K>
- template <class Arg0>
- BOOST_DEDUCED_TYPENAME hash_unique_table<H, P, A, K>::iterator_base
- hash_unique_table<H, P, A, K>::emplace_hint(iterator_base const&,
- Arg0 const& arg0)
- {
- return this->size_ ?
- emplace_impl(extractor::extract(arg0), arg0).first :
- emplace_empty_impl(arg0).first;
- }
-
 #define BOOST_UNORDERED_INSERT_IMPL(z, num_params, _) \
     template <class H, class P, class A, class K> \
     template <BOOST_UNORDERED_TEMPLATE_ARGS(z, num_params)> \
@@ -326,21 +296,7 @@
                 BOOST_UNORDERED_CALL_PARAMS(z, num_params)) : \
             emplace_empty_impl( \
                 BOOST_UNORDERED_CALL_PARAMS(z, num_params)); \
- } \
- \
- template <class H, class P, class A, class K> \
- template <BOOST_UNORDERED_TEMPLATE_ARGS(z, num_params)> \
- BOOST_DEDUCED_TYPENAME hash_unique_table<H, P, A, K>::iterator_base \
- hash_unique_table<H, P, A, K>:: \
- emplace_hint(iterator_base const& it, \
- BOOST_UNORDERED_FUNCTION_PARAMS(z, num_params)) \
- { \
- return this->size_ ? \
- emplace_impl(extractor::extract(arg0, arg1), \
- BOOST_UNORDERED_CALL_PARAMS(z, num_params)) : \
- emplace_empty_impl( \
- BOOST_UNORDERED_CALL_PARAMS(z, num_params)); \
- } \
+ }
 
     BOOST_PP_REPEAT_FROM_TO(2, BOOST_UNORDERED_EMPLACE_LIMIT,
         BOOST_UNORDERED_INSERT_IMPL, _)

Modified: trunk/boost/unordered/unordered_map.hpp
==============================================================================
--- trunk/boost/unordered/unordered_map.hpp (original)
+++ trunk/boost/unordered/unordered_map.hpp 2009-09-22 18:39:17 EDT (Tue, 22 Sep 2009)
@@ -277,10 +277,9 @@
         }
 
         template <class... Args>
- iterator emplace_hint(const_iterator hint, Args&&... args)
+ iterator emplace_hint(const_iterator, Args&&... args)
         {
- return iterator(
- table_.emplace_hint(get(hint), std::forward<Args>(args)...));
+ return iterator(table_.emplace(std::forward<Args>(args)...).first);
         }
 #else
 
@@ -290,10 +289,9 @@
                 table_.emplace(v));
         }
 
- iterator emplace_hint(const_iterator hint,
- value_type const& v = value_type())
+ iterator emplace_hint(const_iterator, value_type const& v = value_type())
         {
- return iterator(table_.emplace_hint(get(hint), v));
+ return iterator(table_.emplace(v).first);
         }
 
 #define BOOST_UNORDERED_EMPLACE(z, n, _) \
@@ -317,9 +315,8 @@
                 BOOST_UNORDERED_FUNCTION_PARAMS(z, n) \
             ) \
             { \
- return iterator(table_.emplace_hint(get(hint), \
- BOOST_UNORDERED_CALL_PARAMS(z, n) \
- )); \
+ return iterator(table_.emplace( \
+ BOOST_UNORDERED_CALL_PARAMS(z, n)).first); \
             }
 
         BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT,
@@ -337,7 +334,7 @@
 
         iterator insert(const_iterator hint, const value_type& obj)
         {
- return iterator(table_.emplace_hint(get(hint), obj));
+ return iterator(table_.emplace(obj).first);
         }
 
         template <class InputIt>

Modified: trunk/boost/unordered/unordered_set.hpp
==============================================================================
--- trunk/boost/unordered/unordered_set.hpp (original)
+++ trunk/boost/unordered/unordered_set.hpp 2009-09-22 18:39:17 EDT (Tue, 22 Sep 2009)
@@ -270,10 +270,9 @@
         }
 
         template <class... Args>
- iterator emplace_hint(const_iterator hint, Args&&... args)
+ iterator emplace_hint(const_iterator, Args&&... args)
         {
- return iterator(
- table_.emplace_hint(get(hint), std::forward<Args>(args)...));
+ return iterator(table_.emplace(std::forward<Args>(args)...).first);
         }
 #else
 
@@ -283,10 +282,10 @@
                 table_.emplace(v));
         }
 
- iterator emplace_hint(const_iterator hint,
+ iterator emplace_hint(const_iterator,
             value_type const& v = value_type())
         {
- return iterator(table_.emplace_hint(get(hint), v));
+ return iterator(table_.emplace(v).first);
         }
 
 #define BOOST_UNORDERED_EMPLACE(z, n, _) \
@@ -306,13 +305,12 @@
             template < \
                 BOOST_UNORDERED_TEMPLATE_ARGS(z, n) \
> \
- iterator emplace_hint(const_iterator hint, \
+ iterator emplace_hint(const_iterator, \
                 BOOST_UNORDERED_FUNCTION_PARAMS(z, n) \
             ) \
             { \
- return iterator(table_.emplace_hint(get(hint), \
- BOOST_UNORDERED_CALL_PARAMS(z, n) \
- )); \
+ return iterator(table_.emplace( \
+ BOOST_UNORDERED_CALL_PARAMS(z, n)).first); \
             }
 
         BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT,
@@ -330,7 +328,7 @@
 
         iterator insert(const_iterator hint, const value_type& obj)
         {
- return iterator(table_.emplace_hint(get(hint), obj));
+ return iterator(table_.emplace(obj).first);
         }
 
         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