summaryrefslogtreecommitdiff
path: root/libs/range/doc/html/range/reference/algorithms/mutating/replace_copy.html
blob: 852cad2e9aa74fad4a0e5f17b6713c6ae8126081 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>replace_copy</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../../../index.html" title="Chapter&#160;1.&#160;Range 2.0">
<link rel="up" href="../mutating.html" title="Mutating algorithms">
<link rel="prev" href="replace.html" title="replace">
<link rel="next" href="replace_copy_if.html" title="replace_copy_if">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="replace.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../mutating.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="replace_copy_if.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="range.reference.algorithms.mutating.replace_copy"></a><a class="link" href="replace_copy.html" title="replace_copy">replace_copy</a>
</h5></div></div></div>
<h6>
<a name="range.reference.algorithms.mutating.replace_copy.h0"></a>
            <span><a name="range.reference.algorithms.mutating.replace_copy.prototype"></a></span><a class="link" href="replace_copy.html#range.reference.algorithms.mutating.replace_copy.prototype">Prototype</a>
          </h6>
<p>
</p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">ForwardRange</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">OutputIterator</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Value</span><span class="special">&gt;</span>
<span class="identifier">OutputIterator</span> <span class="identifier">replace_copy</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">ForwardRange</span><span class="special">&amp;</span> <span class="identifier">rng</span><span class="special">,</span> <span class="identifier">OutputIterator</span> <span class="identifier">out</span><span class="special">,</span>
                            <span class="keyword">const</span> <span class="identifier">Value</span><span class="special">&amp;</span> <span class="identifier">what</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Value</span><span class="special">&amp;</span> <span class="identifier">with_what</span><span class="special">);</span>
</pre>
<p>
          </p>
<h6>
<a name="range.reference.algorithms.mutating.replace_copy.h1"></a>
            <span><a name="range.reference.algorithms.mutating.replace_copy.description"></a></span><a class="link" href="replace_copy.html#range.reference.algorithms.mutating.replace_copy.description">Description</a>
          </h6>
<p>
            <code class="computeroutput"><span class="identifier">replace_copy</span></code> copy every
            element <code class="computeroutput"><span class="identifier">x</span></code> in <code class="computeroutput"><span class="identifier">rng</span></code> such that the corresponding element
            in the output range <code class="computeroutput"><span class="identifier">y</span></code>
            is <code class="computeroutput"><span class="identifier">x</span> <span class="special">==</span>
            <span class="identifier">what</span> <span class="special">?</span>
            <span class="identifier">with_what</span> <span class="special">:</span>
            <span class="identifier">x</span></code>.
          </p>
<h6>
<a name="range.reference.algorithms.mutating.replace_copy.h2"></a>
            <span><a name="range.reference.algorithms.mutating.replace_copy.definition"></a></span><a class="link" href="replace_copy.html#range.reference.algorithms.mutating.replace_copy.definition">Definition</a>
          </h6>
<p>
            Defined in the header file <code class="computeroutput"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">range</span><span class="special">/</span><span class="identifier">algorithm</span><span class="special">/</span><span class="identifier">replace_copy</span><span class="special">.</span><span class="identifier">hpp</span></code>
          </p>
<h6>
<a name="range.reference.algorithms.mutating.replace_copy.h3"></a>
            <span><a name="range.reference.algorithms.mutating.replace_copy.requirements"></a></span><a class="link" href="replace_copy.html#range.reference.algorithms.mutating.replace_copy.requirements">Requirements</a>
          </h6>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
                <code class="computeroutput"><span class="identifier">ForwardRange</span></code> is a
                model of the <a class="link" href="../../../concepts/forward_range.html" title="Forward Range">Forward
                Range</a> Concept.
              </li>
<li class="listitem">
                <code class="computeroutput"><span class="identifier">ForwardRange</span></code> is mutable.
              </li>
<li class="listitem">
                <code class="computeroutput"><span class="identifier">Value</span></code> is convertible
                to <code class="computeroutput"><span class="identifier">ForwardRange</span></code>'s
                value type.
              </li>
<li class="listitem">
                <code class="computeroutput"><span class="identifier">Value</span></code> is a model
                of the <code class="computeroutput"><span class="identifier">AssignableConcept</span></code>.
              </li>
<li class="listitem">
                <code class="computeroutput"><span class="identifier">OutputIterator</span></code> is
                a model of the <code class="computeroutput"><span class="identifier">OutputIteratorConcept</span></code>.
              </li>
</ul></div>
<h6>
<a name="range.reference.algorithms.mutating.replace_copy.h4"></a>
            <span><a name="range.reference.algorithms.mutating.replace_copy.complexity"></a></span><a class="link" href="replace_copy.html#range.reference.algorithms.mutating.replace_copy.complexity">Complexity</a>
          </h6>
<p>
            Linear. <code class="computeroutput"><span class="identifier">replace_copy</span></code>
            performs exactly <code class="computeroutput"><span class="identifier">distance</span><span class="special">(</span><span class="identifier">rng</span><span class="special">)</span></code>.
          </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2010 Thorsten Ottosen,
      Neil Groves<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="replace.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../mutating.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="replace_copy_if.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>