mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-29 19:07:15 +02:00
Remove the emplace_hint implementation for unique containers as it isn't really used and seems to be causing sun 5.7 problems.
[SVN r56363]
This commit is contained in:
@ -629,30 +629,18 @@ namespace boost { namespace unordered_detail {
|
||||
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 @@ namespace boost { namespace unordered_detail {
|
||||
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
|
||||
|
||||
|
@ -272,25 +272,6 @@ namespace boost { namespace unordered_detail {
|
||||
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 @@ namespace boost { namespace unordered_detail {
|
||||
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 @@ namespace boost { namespace unordered_detail {
|
||||
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, _)
|
||||
|
@ -277,10 +277,9 @@ namespace boost
|
||||
}
|
||||
|
||||
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 @@ namespace boost
|
||||
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 @@ namespace boost
|
||||
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 @@ namespace boost
|
||||
|
||||
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>
|
||||
|
@ -270,10 +270,9 @@ namespace boost
|
||||
}
|
||||
|
||||
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 @@ namespace boost
|
||||
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 @@ namespace boost
|
||||
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 @@ namespace boost
|
||||
|
||||
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>
|
||||
|
Reference in New Issue
Block a user