stl:algorithm:remove_if

C++ Reference

remove_if

Syntax:

    #include <algorithm>
    iterator remove_if( iterator start, iterator end, Predicate p );

The remove_if() function removes all elements in the range [start,end) for which the predicate p returns true.

The return value of this function is an iterator to the last element of the pruned range.

remove_if() runs in linear time.

remove_if() cannot be used with associative containers like set<> or map<>.

Related Topics: remove, remove_copy, remove_copy_if