boostorg / container

STL-like containers from Boost
http://www.boost.org/libs/container/
Boost Software License 1.0
96 stars 116 forks source link

flat_map::erase and unique keys #187

Closed mglisse closed 2 years ago

mglisse commented 3 years ago

flat_map is documented as supporting unique keys, but flat_map::erase(key_type) is documented as erasing all the elements with that key (as if there could be several) and indeed the code wastes time looking for a range of equal keys after it has found one equal key.

igaztanaga commented 2 years ago

Thanks for the report, the same optimization can be done for map/set/flat_set.