Open vinipsmaker2 opened 6 years ago
a
is an std:map
so you have to ask the C++ standardization body.
I see. Gonna close the issue then. Once #19 is solved, I'll have a solution for that.
I could add a key::erase_if()
algorithm, like the new std::erase_if algorithm.
That could also address the concern in #19.
That could also address the concern in #19.
erase
would stop once the key is found. erase_if
would iterate until the very end. Also, erase
on a map
could use binary search, which is ruled out for erase_if
.
erase_if
is an useful algorithm, but it's not close enough to erase(key)
.
And the limitation of not being able to use string_view
can be avoided in more elegant ways. The string_view
limitation isn't present in the C++14 std::map::find
algorithm which can be used to get an acceptable value to the erase
function.
Agreed. It makes sense to add both erase
and erase_if
.
This is not the same as #19. #19 is a bug. This is a feature request.
The following code fails:
I have to allocate a
std::string
to erase the proper element. It'd be nice if it worked withstring_view
directly.