Standard C++ Library Class Reference

Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
remove_copy_if
Algorithm
Summary
Move desired elements to the front of a container, and return an iterator that describes where the sequence of desired
elements ends.
Contents
Synopsis
Description
Complexity
Example
Warning
See Also
Synopsis
#include <algorithm>
template <class InputIterator,
class OutputIterator,
class Predicate>
OutputIterator remove_copy_if (InputIterator first,
InputIterator last,
OutputIterator result,
Predicate pred);
Description
The remove_copy_if algorithm copies all the elements referred to by the iterator i in the range [first, last) for which the
following condition does not hold: pred(*i) == true. remove_copy_if returns the end of the resulting range. remove_copy_if is
stable, that is, the relative order of the elements in the resulting range is the same as their relative order in the original range.
Complexity
Exactly last1 - first1 applications of the corresponding predicate are done.
Example
//
// remove.cpp
//
#include <algorithm>