diff --git a/map/multi_fixed.hpp b/map/multi_fixed.hpp index 9208fce7..1495251c 100644 --- a/map/multi_fixed.hpp +++ b/map/multi_fixed.hpp @@ -261,6 +261,23 @@ namespace cruft::map { return tally; } + void + erase_item (value_type const &kv) + { + auto [first, last] = equal_range (kv.first); + + auto const pos = std::find_if ( + first, + last, + [&kv] (auto const &candidate) { return candidate.second == kv.second; } + ); + + if (pos == last) + throw std::out_of_range ("unknown key-value"); + + erase (pos); + } + std::size_t erase (key_type const&);