replace function template — Replaces all occurrences of one value with another value
template<typename FwdIter, typename T>
void replace(FwdIter first, FwdIter last, const T& old_value,
const T& new_value);
The replace
function
template replaces all occurrences of old_value
in [first
, last
) with new_value
. See Figure 13-14 (under replace_copy
) for an example of the
replacement process.