Fixes #187 ("flat_map::erase and unique keys")

This commit is contained in:
Ion Gaztañaga committed 2021-08-08 00:38:29 +02:00
1 parent aaa2485ebf
commit 1cc35bbc98
7 files changed
+55 -27

No files matched your search

+11 -8
View File
@@ -964,6 +964,14 @@ class map
#endif // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
//! <b>Effects</b>: If present, erases the element in the container with key equivalent to x.
//!
//! <b>Returns</b>: Returns the number of erased elements (0/1).
//!
//! <b>Complexity</b>: log(size()) + count(k)
BOOST_CONTAINER_FORCEINLINE size_type erase(const key_type& x)
{ return this->base_t::erase_unique(x); }
#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
//! <b>Effects</b>: Erases the element pointed to by p.
@@ -975,13 +983,6 @@ class map
//! <b>Complexity</b>: Amortized constant time
iterator erase(const_iterator p) BOOST_NOEXCEPT_OR_NOTHROW;
//! <b>Effects</b>: Erases all elements in the container with key equivalent to x.
//!
//! <b>Returns</b>: Returns the number of erased elements.
//!
//! <b>Complexity</b>: log(size()) + count(k)
size_type erase(const key_type& x) BOOST_NOEXCEPT_OR_NOTHROW;
//! <b>Effects</b>: Erases all the elements in the range [first, last).
//!
//! <b>Returns</b>: Returns last.
@@ -989,7 +990,9 @@ class map
//! <b>Complexity</b>: log(size())+N where N is the distance from first to last.
iterator erase(const_iterator first, const_iterator last) BOOST_NOEXCEPT_OR_NOTHROW;
#endif
#else
using base_t::erase;
#endif // #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
//! <b>Effects</b>: Removes the first element in the container with key equivalent to k.
//!