Consistent Container Erasure

Understand the details of 'erase' and 'erase_if' in C++20.

Before C++20, removing elements from a container was too complicated. Let me show you why.

The erase-remove idiom

Removing an element from a container seems to be quite easy. In the case of a std::vector you can use the function std::remove_if.

Get hands-on with 1400+ tech skills courses.