forked from boostorg/container
Fixes #241: flat_map should support same interface as std::map
This commit is contained in:
1 parent
6f10e52887
commit
df03ffc8ec
8 files changed
+142
-3
No files matched your search
@@ -1142,6 +1142,31 @@ class tree
|
||||
return ret;
|
||||
}
|
||||
|
||||
template <class K>
|
||||
inline typename dtl::enable_if_c<
|
||||
dtl::is_transparent<key_compare>::value && //transparent
|
||||
!dtl::is_convertible<K, iterator>::value && //not convertible to iterator
|
||||
!dtl::is_convertible<K, const_iterator>::value //not convertible to const_iterator
|
||||
, size_type>::type
|
||||
erase(const K& k)
|
||||
{ return AllocHolder::erase_key(k, KeyNodeCompare(key_comp()), alloc_version()); }
|
||||
|
||||
template <class K>
|
||||
inline typename dtl::enable_if_c<
|
||||
dtl::is_transparent<key_compare>::value && //transparent
|
||||
!dtl::is_convertible<K, iterator>::value && //not convertible to iterator
|
||||
!dtl::is_convertible<K, const_iterator>::value //not convertible to const_iterator
|
||||
, size_type>::type
|
||||
erase_unique(const K& k)
|
||||
{
|
||||
iterator i = this->find(k);
|
||||
size_type ret = static_cast<size_type>(i != this->end());
|
||||
|
||||
if (ret)
|
||||
this->erase(i);
|
||||
return ret;
|
||||
}
|
||||
|
||||
iterator erase(const_iterator first, const_iterator last)
|
||||
{
|
||||
BOOST_ASSERT(first == last || (first != this->cend() && (priv_is_linked)(first)));
|
||||
|
||||
Reference in new issue
Block a user