C++ ranges are nice, but AFAIK they still "suffer" from the fact that they do not know to modify containers, e.g. if you use ranges::remove you still need to do container.erase(...
Now there are algorithms that do know how to erase from containers (std::erase, std::erase_if) but unlike ranges they do not support projection.
My question if this is just because (AFAIK) that functionality was proposed separately from ranges(+ lack of time/lack of proposals), or is there fundamental reason why this functionality is not available.
std::eraseandstd::erase_ifare not algorithms applicable to any container. They are an overload set of functions that do "the same thing" to many containers.The associative containers don't have
std::erase, because it would either be inconsistent with their membererase, or it would be inconsistent with the sequence containererase.I don't think there is a fundamental incompatibility with having a projection argument in
erase_if, nor inerasewhere it is present, but they were defined in terms of the existingstd::remove,std::remove_ifand membererases andremoves, which lack projections.