||Component type: function
template <class InputIterator, class OutputIterator, class Predicate>
OutputIterator remove_copy_if(InputIterator first, InputIterator last,
OutputIterator result, Predicate pred);
Remove_copy_if copies elements from the range [first, last) to a
range beginning at result, except that elements for which pred
is true are not copied. The return
value is the end of the resulting range. This operation is stable,
meaning that the relative order of the elements that are copied is the same
as in the range [first, last).
Defined in the standard header algorithm, and in the nonstandard
backward-compatibility header algo.h.
Requirements on types
InputIterator is a model of Input Iterator.
OutputIterator is a model of Output Iterator.
InputIterator's value type is convertible to a type in
OutputIterator's set of value types.
Predicate is a model of Predicate.
InputIterator's value type is convertible to Predicate's argument
[first, last) is a valid range.
There is enough space in the output range to store the copied
values. That is, if there are n elements in [first, last)
that do not satisfy pred, then [result, result+n) is
a valid range.
result is not an iterator in the range [first, last).
Linear. Exactly last - first applications of pred, and at most
last - first assignments.
Fill a vector with the nonnegative elements of another vector.
copy, remove, remove_if, remove_copy,
STL Main Page