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

This commit is contained in:
Ion Gaztañaga
2021-08-08 00:38:29 +02:00
parent aaa2485ebf
commit 1cc35bbc98
7 changed files with 55 additions and 27 deletions
+3 -3
View File
@@ -1265,14 +1265,14 @@ class flat_map
(m_flat_tree.erase(dtl::force_copy<impl_const_iterator>(p)));
}
//! <b>Effects</b>: Erases all elements in the container with key equivalent to x.
//! <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.
//! <b>Returns</b>: Returns the number of erased elements (0/1).
//!
//! <b>Complexity</b>: Logarithmic search time plus erasure time
//! linear to the elements with bigger keys.
BOOST_CONTAINER_FORCEINLINE size_type erase(const key_type& x)
{ return m_flat_tree.erase(x); }
{ return m_flat_tree.erase_unique(x); }
//! <b>Effects</b>: Erases all the elements in the range [first, last).
//!