blob: e936fc035f8d5e59c72aae8eb2eaa556e98fda33 [file] [log] [blame]
Brian Silverman598d0292018-08-04 23:56:47 -07001[/
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)
5/]
6[section:replace_copy replace_copy]
7
8[heading Prototype]
9
10``
11template<class ForwardRange, class OutputIterator, class Value>
12OutputIterator replace_copy(const ForwardRange& rng, OutputIterator out,
13 const Value& what, const Value& with_what);
14``
15
16[heading Description]
17
18`replace_copy` copy every element `x` in `rng` such that the corresponding element in the output range `y` is `x == what ? with_what : x`.
19
20[heading Definition]
21
22Defined in the header file `boost/range/algorithm/replace_copy.hpp`
23
24[heading Requirements]
25
26* `ForwardRange` is a model of the __forward_range__ Concept.
27* `ForwardRange` is mutable.
28* `Value` is convertible to `ForwardRange`'s value type.
29* `Value` is a model of the `AssignableConcept`.
30* `OutputIterator` is a model of the `OutputIteratorConcept`.
31
32[heading Complexity]
33
34Linear. `replace_copy` performs exactly `distance(rng)`.
35
36[endsect]
37
38