replace_if [C++ Reference]
Keywords: stl,algorithm,replace_if
Date: 2009-10-09T01:18:10-0700

[[replace_if]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## replace_if

Syntax:

        #include <algorithm>
        void replace_if( forward_iterator start, forward_iterator end, Predicate p, const TYPE& new_value );

The replace_if() function assigns every element in the range [start,end) for which the predicate function p returns true the value of new_value.

This function runs in linear time.

Related Topics: replace

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •