2 Copyright 2010 Neil Groves
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 [section:replace_if replace_if]
11 template<class ForwardRange, class UnaryPredicate, class Value>
12 ForwardRange& replace_if(ForwardRange& rng, UnaryPredicate pred, const Value& with_what);
14 template<class ForwardRange, class UnaryPredicate, class Value>
15 const ForwardRange& replace_if(const ForwardRange& rng, UnaryPredicate pred, const Value& with_what);
20 `replace_if` replaces every element `x` in `rng` for which `pred(x) == true` with `with_what`. Returns a reference to `rng`.
24 Defined in the header file `boost/range/algorithm/replace_if.hpp`
26 [heading Requirements]
28 * `ForwardRange` is a model of the __forward_range__ Concept.
29 * `ForwardRange` is mutable.
30 * `UnaryPredicate` is a model of the `PredicateConcept`
31 * `ForwardRange`'s value type is convertible to `UnaryPredicate`'s argument type.
32 * `Value` is convertible to `ForwardRange`'s value type.
33 * `Value` is a model of the `AssignableConcept`.
37 Linear. `replace_if` performs exactly `distance(rng)` applications of `pred`, and at most `distance(rng)` assignments.