Use Uniform Erasure Functions to Delete Items from a Container

Learn to use uniform erasure functions to delete items from a container.

We'll cover the following

Before C++20, the erase-remove idiomThe erase-remove idiom is a programming technique used to remove elements from a container (such as a vector) based on a specified condition. was commonly used to efficiently delete elements from an STL container. This was a little cumbersome, but not a great burden. It was common to use a function like this for the task:

Get hands-on with 1200+ tech skills courses.