Template:cpp/container/erase if

Erases all elements that satisfy the predicate from the container. Equivalent to

Return value
The number of erased elements.

Complexity
Linear.