File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed
Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -801,6 +801,15 @@ class flat_set
801801 // ! linear to the elements with bigger keys.
802802 iterator erase (const_iterator first, const_iterator last);
803803
804+ // ! <b>Requires</b>: This overload is available only if
805+ // ! key_compare::is_transparent exists.
806+ // !
807+ // ! <b>Effects</b>: If present, erases the element in the container with key equivalent to x.
808+ // !
809+ // ! <b>Returns</b>: Returns the number of erased elements.
810+ template <class K >
811+ size_type erase (K && k);
812+
804813 // ! <b>Effects</b>: Swaps the contents of *this and x.
805814 // !
806815 // ! <b>Throws</b>: Nothing.
@@ -1736,6 +1745,10 @@ class flat_multiset
17361745 // ! @copydoc ::boost::container::flat_set::erase(const_iterator,const_iterator)
17371746 iterator erase (const_iterator first, const_iterator last);
17381747
1748+ // ! @copydoc ::boost::container::flat_set::erase(K&&)
1749+ template <class K >
1750+ size_type erase (K && k);
1751+
17391752 // ! @copydoc ::boost::container::flat_set::swap
17401753 void swap (flat_multiset& x)
17411754 BOOST_NOEXCEPT_IF( allocator_traits_type::is_always_equal::value
Original file line number Diff line number Diff line change @@ -580,6 +580,16 @@ bool test_heterogeneous_lookups()
580580 if (*cmset1.equal_range (find_me).second != 3 )
581581 return false ;
582582
583+ // erase
584+ if (set1.erase (find_me) != 1 )
585+ return false ;
586+ if (set1.erase (find_me) != 0 )
587+ return false ;
588+ if (mset1.erase (find_me) != 2 )
589+ return false ;
590+ if (mset1.erase (find_me) != 0 )
591+ return false ;
592+
583593 return true ;
584594}
585595
Original file line number Diff line number Diff line change @@ -437,6 +437,16 @@ bool test_heterogeneous_lookups()
437437 if (*cmset1.equal_range (find_me).second != 3 )
438438 return false ;
439439
440+ // erase
441+ if (set1.erase (find_me) != 1 )
442+ return false ;
443+ if (set1.erase (find_me) != 0 )
444+ return false ;
445+ if (mset1.erase (find_me) != 2 )
446+ return false ;
447+ if (mset1.erase (find_me) != 0 )
448+ return false ;
449+
440450 return true ;
441451}
442452
You can’t perform that action at this time.
0 commit comments