Standard C++ Library Class Reference
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
replace
Algorithm
Summary
Substitutes elements stored in a collection with new values.
Contents
Synopsis●
Description●
Complexity●
Example●
Warning●
See Also●
Synopsis
#include <algorithm>
template <class ForwardIterator, class T>
void replace (ForwardIterator first,
ForwardIterator last,
const T& old_value,
const T& new_value);
Description
The replace algorithm replaces elements referred to by iterator i in the range [first, last) with
new_value when the following condition holds: *i == old_value