• 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::insert (11 of 11 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="../insert.html" title="basic_static_string::insert">
9<link rel="prev" href="overload10.html" title="basic_static_string::insert (10 of 11 overloads)">
10<link rel="next" href="../erase.html" title="basic_static_string::erase">
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="overload10.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../insert.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="../erase.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.insert.overload11"></a><a class="link" href="overload11.html" title="basic_static_string::insert (11 of 11 overloads)">basic_static_string::insert
28          (11 of 11 overloads)</a>
29</h5></div></div></div>
30<p>
31            Insert into the string.
32          </p>
33<h6>
34<a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.h0"></a>
35            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.synopsis"></a></span><a class="link" href="overload11.html#static_string.ref.boost__static_strings__basic_static_string.insert.overload11.synopsis">Synopsis</a>
36          </h6>
37<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span>
38    <span class="special">[</span><span class="identifier">role</span> <span class="identifier">red</span> <span class="identifier">error</span><span class="special">.</span><span class="identifier">param</span> <span class="identifier">neither</span> <span class="identifier">has</span> <span class="identifier">a</span> <span class="identifier">declname</span> <span class="identifier">nor</span> <span class="identifier">a</span> <span class="char">'class '</span> <span class="identifier">prefix</span> <span class="identifier">in</span> <span class="identifier">the</span> <span class="identifier">type</span><span class="special">][</span><span class="identifier">role</span> <span class="identifier">red</span> <span class="identifier">error</span><span class="special">.</span><span class="identifier">param</span> <span class="identifier">neither</span> <span class="identifier">has</span> <span class="identifier">a</span> <span class="identifier">declname</span> <span class="identifier">nor</span> <span class="identifier">a</span> <span class="char">'class '</span> <span class="identifier">prefix</span> <span class="identifier">in</span> <span class="identifier">the</span> <span class="identifier">type</span><span class="special">][</span><span class="identifier">role</span> <span class="identifier">red</span> <span class="identifier">error</span><span class="special">.</span><span class="identifier">param</span> <span class="identifier">neither</span> <span class="identifier">has</span> <span class="identifier">a</span> <span class="identifier">declname</span> <span class="identifier">nor</span> <span class="identifier">a</span> <span class="char">'class '</span> <span class="identifier">prefix</span> <span class="identifier">in</span> <span class="identifier">the</span> <span class="identifier">type</span><span class="special">][</span><span class="identifier">role</span> <span class="identifier">red</span> <span class="identifier">error</span><span class="special">.</span><span class="identifier">param</span> <span class="identifier">neither</span> <span class="identifier">has</span> <span class="identifier">a</span> <span class="identifier">declname</span> <span class="identifier">nor</span> <span class="identifier">a</span> <span class="char">'class '</span> <span class="identifier">prefix</span> <span class="identifier">in</span> <span class="identifier">the</span> <span class="identifier">type</span><span class="special">]&gt;</span>
39<span class="keyword">constexpr</span> <span class="identifier">basic_static_string</span><span class="special">&amp;</span>
40<span class="identifier">insert</span><span class="special">(</span>
41    <span class="identifier">size_type</span> <span class="identifier">index</span><span class="special">,</span>
42    <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;</span> <span class="identifier">t</span><span class="special">,</span>
43    <span class="identifier">size_type</span> <span class="identifier">index_str</span><span class="special">,</span>
44    <span class="identifier">size_type</span> <span class="identifier">count</span> <span class="special">=</span> <a class="link" href="../npos.html" title="basic_static_string::npos">npos</a><span class="special">);</span>
45</pre>
46<h6>
47<a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.h1"></a>
48            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.description"></a></span><a class="link" href="overload11.html#static_string.ref.boost__static_strings__basic_static_string.insert.overload11.description">Description</a>
49          </h6>
50<p>
51            Constructs a temporary <code class="computeroutput"><span class="identifier">string_view_type</span></code>
52            object <code class="computeroutput"><span class="identifier">sv</span></code> from <code class="computeroutput"><span class="identifier">t</span></code> and inserts <code class="computeroutput"><span class="identifier">sv</span><span class="special">.</span><span class="identifier">substr</span><span class="special">(</span><span class="identifier">index_str</span><span class="special">,</span> <span class="identifier">count</span><span class="special">)</span></code> at <code class="computeroutput"><span class="identifier">index</span></code>.
53          </p>
54<h6>
55<a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.h2"></a>
56            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.exception_safety"></a></span><a class="link" href="overload11.html#static_string.ref.boost__static_strings__basic_static_string.insert.overload11.exception_safety">Exception
57            Safety</a>
58          </h6>
59<p>
60            Strong guarantee.
61          </p>
62<h6>
63<a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.h3"></a>
64            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.remarks"></a></span><a class="link" href="overload11.html#static_string.ref.boost__static_strings__basic_static_string.insert.overload11.remarks">Remarks</a>
65          </h6>
66<p>
67            All references, pointers, or iterators referring to contained elements
68            are invalidated. Any past-the-end iterators are also invalidated.
69          </p>
70<h6>
71<a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.h4"></a>
72            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.template_parameters"></a></span><a class="link" href="overload11.html#static_string.ref.boost__static_strings__basic_static_string.insert.overload11.template_parameters">Template
73            Parameters</a>
74          </h6>
75<div class="informaltable"><table class="table">
76<colgroup>
77<col>
78<col>
79</colgroup>
80<thead><tr>
81<th>
82                    <p>
83                      Type
84                    </p>
85                  </th>
86<th>
87                    <p>
88                      Description
89                    </p>
90                  </th>
91</tr></thead>
92<tbody><tr>
93<td>
94                    <p>
95                      <code class="computeroutput"><span class="identifier">T</span></code>
96                    </p>
97                  </td>
98<td>
99                    <p>
100                      The type of the object to convert.
101                    </p>
102                  </td>
103</tr></tbody>
104</table></div>
105<h6>
106<a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.h5"></a>
107            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.constraints"></a></span><a class="link" href="overload11.html#static_string.ref.boost__static_strings__basic_static_string.insert.overload11.constraints">Constraints</a>
108          </h6>
109<p>
110            <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">is_convertible</span><span class="special">&lt;</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;,</span> <span class="identifier">string_view</span><span class="special">&gt;::</span><span class="identifier">value</span>
111            <span class="special">&amp;&amp;</span> <span class="special">!</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">is_convertible</span><span class="special">&lt;</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&amp;,</span> <span class="identifier">const_pointer</span><span class="special">&gt;::</span><span class="identifier">value</span></code>.
112          </p>
113<h6>
114<a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.h6"></a>
115            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.return_value"></a></span><a class="link" href="overload11.html#static_string.ref.boost__static_strings__basic_static_string.insert.overload11.return_value">Return
116            Value</a>
117          </h6>
118<p>
119            <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>
120          </p>
121<h6>
122<a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.h7"></a>
123            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.parameters"></a></span><a class="link" href="overload11.html#static_string.ref.boost__static_strings__basic_static_string.insert.overload11.parameters">Parameters</a>
124          </h6>
125<div class="informaltable"><table class="table">
126<colgroup>
127<col>
128<col>
129</colgroup>
130<thead><tr>
131<th>
132                    <p>
133                      Name
134                    </p>
135                  </th>
136<th>
137                    <p>
138                      Description
139                    </p>
140                  </th>
141</tr></thead>
142<tbody>
143<tr>
144<td>
145                    <p>
146                      <code class="computeroutput"><span class="identifier">index</span></code>
147                    </p>
148                  </td>
149<td>
150                    <p>
151                      The index to insert at.
152                    </p>
153                  </td>
154</tr>
155<tr>
156<td>
157                    <p>
158                      <code class="computeroutput"><span class="identifier">t</span></code>
159                    </p>
160                  </td>
161<td>
162                    <p>
163                      The string to insert from.
164                    </p>
165                  </td>
166</tr>
167<tr>
168<td>
169                    <p>
170                      <code class="computeroutput"><span class="identifier">index_str</span></code>
171                    </p>
172                  </td>
173<td>
174                    <p>
175                      The index in the temporary <code class="computeroutput"><span class="identifier">string_view_type</span></code>
176                      object to start the substring from.
177                    </p>
178                  </td>
179</tr>
180<tr>
181<td>
182                    <p>
183                      <code class="computeroutput"><span class="identifier">count</span></code>
184                    </p>
185                  </td>
186<td>
187                    <p>
188                      The number of characters to insert.
189                    </p>
190                  </td>
191</tr>
192</tbody>
193</table></div>
194<h6>
195<a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.h8"></a>
196            <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.insert.overload11.exceptions"></a></span><a class="link" href="overload11.html#static_string.ref.boost__static_strings__basic_static_string.insert.overload11.exceptions">Exceptions</a>
197          </h6>
198<div class="informaltable"><table class="table">
199<colgroup>
200<col>
201<col>
202</colgroup>
203<thead><tr>
204<th>
205                    <p>
206                      Type
207                    </p>
208                  </th>
209<th>
210                    <p>
211                      Thrown On
212                    </p>
213                  </th>
214</tr></thead>
215<tbody>
216<tr>
217<td>
218                    <p>
219                      <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">length_error</span></code>
220                    </p>
221                  </td>
222<td>
223                    <p>
224                      <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>
225                      + sv.size() &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>
226                    </p>
227                  </td>
228</tr>
229<tr>
230<td>
231                    <p>
232                      <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">out_of_range</span></code>
233                    </p>
234                  </td>
235<td>
236                    <p>
237                      index &gt; <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>
238                    </p>
239                  </td>
240</tr>
241<tr>
242<td>
243                    <p>
244                      <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">out_of_range</span></code>
245                    </p>
246                  </td>
247<td>
248                    <p>
249                      <code class="computeroutput"><span class="identifier">index_str</span> <span class="special">&gt;</span> <span class="identifier">sv</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span></code>
250                    </p>
251                  </td>
252</tr>
253</tbody>
254</table></div>
255</div>
256<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
257<td align="left"></td>
258<td align="right"><div class="copyright-footer">Copyright © 2019, 2020 Krystian Stasiowski<br>Copyright © 2016-2019 Vinnie
259      Falco<p>
260        Distributed under the Boost Software License, Version 1.0. (See accompanying
261        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>)
262      </p>
263</div></td>
264</tr></table>
265<hr>
266<div class="spirit-nav">
267<a accesskey="p" href="overload10.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../insert.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="../erase.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
268</div>
269</body>
270</html>
271