Standard C++ Library Class Reference
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
remove_copy
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 T>
OutputIterator remove_copy (InputIterator first,
InputIterator last,
OutputIterator result,
const T& value);
Description
The remove_copy algorithm copies all the elements referred to by the iterator i in the range [first, last) for which the
following corresponding condition does not hold: *i == value. remove_copy returns the end of the resulting range.
remove_copy 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. The elements in the original sequence are not altered by remove_copy.
Complexity
Exactly last1 - first1 applications of the corresponding predicate are done.
Example
//
// remove.cpp
//