I was watching some programming videos and found this one:
C++20's Uniform Container ErasureIt seems C++ is finally getting an easy way to remove items from containers. For example, to remove all occurrences of a value from a vector:
This is in contrast to the older and much more verbose way:
vec.erase(std::remove(vec.begin(), vec.end(), value), vec.end());
The paper about it is here:
Uniform Container ErasureSome documentation can be found at:
C++ standard libraries extensions, version 2You'll notice the documentation links to specific methods for each of the container types, including
std::string which isn't always thought of as a container.