replace

Syntax:

    #include <algorithm>
    void replace( iterator start, iterator end, const TYPE& old_value, const TYPE& new_value );

The replace() function sets every element in the range [start,end) that is equal to old_value to have new_value instead.

replace() runs in linear time.

Related Topics: replace_copy, replace_copy_if, replace_if