A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://sgistl.github.io/remove_copy.html below:

remove_copy

remove_copy Prototype
template <class InputIterator, class OutputIterator, class T>
OutputIterator remove_copy(InputIterator first, InputIterator last,
                           OutputIterator result, const T& value);
DescriptionRemove_copy copies elements that are not equal to value from the range [first, last) to a range beginning at result. 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). Definition Defined in the standard header algorithm, and in the nonstandard backward-compatibility header algo.h. Requirements on types Preconditions Complexity Linear. Exactly last - first comparisons for equality, and at most last - first assignments. Example Print all nonzero elements of a vector on the standard output.
vector<int> V;
V.push_back(-2);
V.push_back(0);
V.push_back(-1);
V.push_back(0);
V.push_back(1);
V.push_back(2);

remove_copy(V.begin(), V.end(), 
            ostream_iterator<int>(cout, "\n"),
            0);
Notes See alsocopy, remove, remove_if, remove_copy_if, unique, unique_copy. STL Main Page

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4