Convert remove and remove_if to the C++20 std::erase and std::erase_if overloads.
The legacy ones can be confusing, because:
- Array-based containers (like vector) must use the erase-remove idiom. Forgetting the erase, or forgetting to pass the end iterator (
bugprone-inaccurate-erase) can be a bug, see also #36588 (review). So a call only to "remove" will not erase. - Node-based containers (like list or set) must not use the idiom. Using it will be a pessimization or won't compile. And correctly not using the idiom reads confusing, because a call to "remove" will actually erase.
- They are more verbose.
Also convert simple iterator-erase (which is verbose, but fine) to the std overload.