• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>basic_static_string::replace (10 of 14 overloads)</title>
5<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../../../../index.html" title="Boost.StaticString">
8<link rel="up" href="../replace.html" title="basic_static_string::replace">
9<link rel="prev" href="overload9.html" title="basic_static_string::replace (9 of 14 overloads)">
10<link rel="next" href="overload11.html" title="basic_static_string::replace (11 of 14 overloads)">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr>
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
15<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
16<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="overload9.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../replace.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="overload11.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h5 class="title">
27<a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10"></a><a class="link" href="overload10.html" title="basic_static_string::replace (10 of 14 overloads)">basic_static_string::replace
28          (10 of 14 overloads)</a>
29</h5></div></div></div>
30<p>
31            Replace a part of the string.
32          </p>
33<h6>
34<a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10.h0"></a>
35            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10.synopsis"></a></span><a class="link" href="overload10.html#static_string.ref.boost__static_strings__basic_static_string.replace.overload10.synopsis">Synopsis</a>
36          </h6>
37<pre class="programlisting"><span class="keyword">constexpr</span> <span class="identifier">basic_static_string</span><span class="special">&amp;</span>
38<span class="identifier">replace</span><span class="special">(</span>
39    <span class="identifier">const_iterator</span> <span class="identifier">i1</span><span class="special">,</span>
40    <span class="identifier">const_iterator</span> <span class="identifier">i2</span><span class="special">,</span>
41    <span class="identifier">const_pointer</span> <span class="identifier">s</span><span class="special">,</span>
42    <span class="identifier">size_type</span> <span class="identifier">n</span><span class="special">);</span>
43</pre>
44<h6>
45<a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10.h1"></a>
46            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10.description"></a></span><a class="link" href="overload10.html#static_string.ref.boost__static_strings__basic_static_string.replace.overload10.description">Description</a>
47          </h6>
48<p>
49            Replaces the characters in the range <code class="computeroutput"><span class="special">{</span><span class="identifier">i1</span><span class="special">,</span> <span class="identifier">i2</span><span class="special">)</span></code>
50            with those of <code class="computeroutput"><span class="special">{</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">s</span> <span class="special">+</span> <span class="identifier">n</span><span class="special">)</span></code>.
51          </p>
52<h6>
53<a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10.h2"></a>
54            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10.precondition"></a></span><a class="link" href="overload10.html#static_string.ref.boost__static_strings__basic_static_string.replace.overload10.precondition">Precondition</a>
55          </h6>
56<p>
57            <code class="computeroutput"><span class="special">{</span><span class="identifier">i1</span><span class="special">,</span> <span class="identifier">i2</span><span class="special">)</span></code>is a valid range.
58          </p>
59<h6>
60<a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10.h3"></a>
61            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10.exception_safety"></a></span><a class="link" href="overload10.html#static_string.ref.boost__static_strings__basic_static_string.replace.overload10.exception_safety">Exception
62            Safety</a>
63          </h6>
64<p>
65            Strong guarantee.
66          </p>
67<h6>
68<a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10.h4"></a>
69            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10.remarks"></a></span><a class="link" href="overload10.html#static_string.ref.boost__static_strings__basic_static_string.replace.overload10.remarks">Remarks</a>
70          </h6>
71<p>
72            All references, pointers, or iterators referring to contained elements
73            are invalidated. Any past-the-end iterators are also invalidated.
74          </p>
75<h6>
76<a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10.h5"></a>
77            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10.return_value"></a></span><a class="link" href="overload10.html#static_string.ref.boost__static_strings__basic_static_string.replace.overload10.return_value">Return
78            Value</a>
79          </h6>
80<p>
81            <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
82          </p>
83<h6>
84<a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10.h6"></a>
85            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10.parameters"></a></span><a class="link" href="overload10.html#static_string.ref.boost__static_strings__basic_static_string.replace.overload10.parameters">Parameters</a>
86          </h6>
87<div class="informaltable"><table class="table">
88<colgroup>
89<col>
90<col>
91</colgroup>
92<thead><tr>
93<th>
94                    <p>
95                      Name
96                    </p>
97                  </th>
98<th>
99                    <p>
100                      Description
101                    </p>
102                  </th>
103</tr></thead>
104<tbody>
105<tr>
106<td>
107                    <p>
108                      <code class="computeroutput"><span class="identifier">i1</span></code>
109                    </p>
110                  </td>
111<td>
112                    <p>
113                      An iterator referring to the first character to replace.
114                    </p>
115                  </td>
116</tr>
117<tr>
118<td>
119                    <p>
120                      <code class="computeroutput"><span class="identifier">i2</span></code>
121                    </p>
122                  </td>
123<td>
124                    <p>
125                      An iterator referring past the end of the last character to
126                      replace.
127                    </p>
128                  </td>
129</tr>
130<tr>
131<td>
132                    <p>
133                      <code class="computeroutput"><span class="identifier">s</span></code>
134                    </p>
135                  </td>
136<td>
137                    <p>
138                      The string to replace with.
139                    </p>
140                  </td>
141</tr>
142<tr>
143<td>
144                    <p>
145                      <code class="computeroutput"><span class="identifier">n</span></code>
146                    </p>
147                  </td>
148<td>
149                    <p>
150                      The length of the string to replace with.
151                    </p>
152                  </td>
153</tr>
154</tbody>
155</table></div>
156<h6>
157<a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10.h7"></a>
158            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload10.exceptions"></a></span><a class="link" href="overload10.html#static_string.ref.boost__static_strings__basic_static_string.replace.overload10.exceptions">Exceptions</a>
159          </h6>
160<div class="informaltable"><table class="table">
161<colgroup>
162<col>
163<col>
164</colgroup>
165<thead><tr>
166<th>
167                    <p>
168                      Type
169                    </p>
170                  </th>
171<th>
172                    <p>
173                      Thrown On
174                    </p>
175                  </th>
176</tr></thead>
177<tbody><tr>
178<td>
179                    <p>
180                      <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">length_error</span></code>
181                    </p>
182                  </td>
183<td>
184                    <p>
185                      <a class="link" href="../size.html" title="basic_static_string::size"><code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code></a>
186                      + (n - std::distance(i1, i2)) &gt; <a class="link" href="../max_size.html" title="basic_static_string::max_size"><code class="computeroutput"><span class="identifier">max_size</span><span class="special">()</span></code></a>
187                    </p>
188                  </td>
189</tr></tbody>
190</table></div>
191</div>
192<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
193<td align="left"></td>
194<td align="right"><div class="copyright-footer">Copyright © 2019, 2020 Krystian Stasiowski<br>Copyright © 2016-2019 Vinnie
195      Falco<p>
196        Distributed under the Boost Software License, Version 1.0. (See accompanying
197        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>)
198      </p>
199</div></td>
200</tr></table>
201<hr>
202<div class="spirit-nav">
203<a accesskey="p" href="overload9.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../replace.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="overload11.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
204</div>
205</body>
206</html>
207