mirror of
https://github.com/boostorg/unordered.git
synced 2025-11-08 11:41:44 +01:00
Add transparent insert() overloads to unordered_[flat]_set
This commit is contained in:
@@ -390,6 +390,15 @@ namespace boost {
|
||||
return this->emplace(boost::move(x));
|
||||
}
|
||||
|
||||
template <class Key>
|
||||
typename boost::enable_if_c<
|
||||
detail::transparent_non_iterable<Key, unordered_set>::value,
|
||||
std::pair<iterator, bool> >::type
|
||||
insert(BOOST_FWD_REF(Key) k)
|
||||
{
|
||||
return table_.try_emplace_unique(boost::forward<Key>(k));
|
||||
}
|
||||
|
||||
iterator insert(const_iterator hint, value_type const& x)
|
||||
{
|
||||
return this->emplace_hint(hint, x);
|
||||
@@ -400,6 +409,15 @@ namespace boost {
|
||||
return this->emplace_hint(hint, boost::move(x));
|
||||
}
|
||||
|
||||
template <class Key>
|
||||
typename boost::enable_if_c<
|
||||
detail::transparent_non_iterable<Key, unordered_set>::value,
|
||||
iterator>::type
|
||||
insert(const_iterator hint, BOOST_FWD_REF(Key) k)
|
||||
{
|
||||
return table_.try_emplace_hint_unique(hint, boost::forward<Key>(k));
|
||||
}
|
||||
|
||||
template <class InputIt> void insert(InputIt, InputIt);
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
|
||||
Reference in New Issue
Block a user