std::erase(_if) is a nice addition to C++20(finally I can forget about obnoxious erase-remove idiom), but one thing is weird:
it is not a generic algorithm in a sense that it only works for std:: containers, e.g. it can not operate on boost vector.
#include<string>
#include<vector>
#include<boost/container/vector.hpp>
int main() {
std::string str = " Hello World !";
std::erase(str, ' '); // :)
boost::container::vector<int> vi{1,2};
std::erase(vi, 2); // :(
}
My best guess is that the algorithm was in experimental long before concepts were voted in standard so it was a lot of work to rework it, or that there was fear that concept for it could not be specified properly(i.e. it would work incorrectly on some user defined types with funky semantics).
So: my question is why is this not a generic algorithm in with some Concept(or enable_if) requirements/dispatching(e.g. for map/set)?