• 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 (14 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="overload13.html" title="basic_static_string::replace (13 of 14 overloads)">
10<link rel="next" href="../find.html" title="basic_static_string::find">
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="overload13.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="../find.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.overload14"></a><a class="link" href="overload14.html" title="basic_static_string::replace (14 of 14 overloads)">basic_static_string::replace
28          (14 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.overload14.h0"></a>
35            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload14.synopsis"></a></span><a class="link" href="overload14.html#static_string.ref.boost__static_strings__basic_static_string.replace.overload14.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">std</span><span class="special">::</span><span class="identifier">initializer_list</span><span class="special">&lt;</span> <span class="identifier">value_type</span> <span class="special">&gt;</span> <span class="identifier">il</span><span class="special">);</span>
42</pre>
43<h6>
44<a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload14.h1"></a>
45            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload14.description"></a></span><a class="link" href="overload14.html#static_string.ref.boost__static_strings__basic_static_string.replace.overload14.description">Description</a>
46          </h6>
47<p>
48            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>
49            with those of contained in the initializer list <code class="computeroutput"><span class="identifier">il</span></code>.
50          </p>
51<h6>
52<a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload14.h2"></a>
53            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload14.precondition"></a></span><a class="link" href="overload14.html#static_string.ref.boost__static_strings__basic_static_string.replace.overload14.precondition">Precondition</a>
54          </h6>
55<p>
56            <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.
57          </p>
58<h6>
59<a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload14.h3"></a>
60            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload14.exception_safety"></a></span><a class="link" href="overload14.html#static_string.ref.boost__static_strings__basic_static_string.replace.overload14.exception_safety">Exception
61            Safety</a>
62          </h6>
63<p>
64            Strong guarantee.
65          </p>
66<h6>
67<a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload14.h4"></a>
68            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload14.remarks"></a></span><a class="link" href="overload14.html#static_string.ref.boost__static_strings__basic_static_string.replace.overload14.remarks">Remarks</a>
69          </h6>
70<p>
71            All references, pointers, or iterators referring to contained elements
72            are invalidated. Any past-the-end iterators are also invalidated.
73          </p>
74<h6>
75<a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload14.h5"></a>
76            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload14.return_value"></a></span><a class="link" href="overload14.html#static_string.ref.boost__static_strings__basic_static_string.replace.overload14.return_value">Return
77            Value</a>
78          </h6>
79<p>
80            <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
81          </p>
82<h6>
83<a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload14.h6"></a>
84            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload14.parameters"></a></span><a class="link" href="overload14.html#static_string.ref.boost__static_strings__basic_static_string.replace.overload14.parameters">Parameters</a>
85          </h6>
86<div class="informaltable"><table class="table">
87<colgroup>
88<col>
89<col>
90</colgroup>
91<thead><tr>
92<th>
93                    <p>
94                      Name
95                    </p>
96                  </th>
97<th>
98                    <p>
99                      Description
100                    </p>
101                  </th>
102</tr></thead>
103<tbody>
104<tr>
105<td>
106                    <p>
107                      <code class="computeroutput"><span class="identifier">i1</span></code>
108                    </p>
109                  </td>
110<td>
111                    <p>
112                      An iterator referring to the first character to replace.
113                    </p>
114                  </td>
115</tr>
116<tr>
117<td>
118                    <p>
119                      <code class="computeroutput"><span class="identifier">i2</span></code>
120                    </p>
121                  </td>
122<td>
123                    <p>
124                      An iterator past the end of the last character to replace.
125                    </p>
126                  </td>
127</tr>
128<tr>
129<td>
130                    <p>
131                      <code class="computeroutput"><span class="identifier">il</span></code>
132                    </p>
133                  </td>
134<td>
135                    <p>
136                      The initializer list to replace with.
137                    </p>
138                  </td>
139</tr>
140</tbody>
141</table></div>
142<h6>
143<a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload14.h7"></a>
144            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.replace.overload14.exceptions"></a></span><a class="link" href="overload14.html#static_string.ref.boost__static_strings__basic_static_string.replace.overload14.exceptions">Exceptions</a>
145          </h6>
146<div class="informaltable"><table class="table">
147<colgroup>
148<col>
149<col>
150</colgroup>
151<thead><tr>
152<th>
153                    <p>
154                      Type
155                    </p>
156                  </th>
157<th>
158                    <p>
159                      Thrown On
160                    </p>
161                  </th>
162</tr></thead>
163<tbody><tr>
164<td>
165                    <p>
166                      <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">length_error</span></code>
167                    </p>
168                  </td>
169<td>
170                    <p>
171                      <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>
172                      + (il.size() - 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>
173                    </p>
174                  </td>
175</tr></tbody>
176</table></div>
177</div>
178<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
179<td align="left"></td>
180<td align="right"><div class="copyright-footer">Copyright © 2019, 2020 Krystian Stasiowski<br>Copyright © 2016-2019 Vinnie
181      Falco<p>
182        Distributed under the Boost Software License, Version 1.0. (See accompanying
183        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>)
184      </p>
185</div></td>
186</tr></table>
187<hr>
188<div class="spirit-nav">
189<a accesskey="p" href="overload13.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="../find.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
190</div>
191</body>
192</html>
193