1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>basic_static_string::assign (3 of 9 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="../assign.html" title="basic_static_string::assign"> 9<link rel="prev" href="overload2.html" title="basic_static_string::assign (2 of 9 overloads)"> 10<link rel="next" href="overload4.html" title="basic_static_string::assign (4 of 9 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="overload2.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../assign.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="overload4.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.assign.overload3"></a><a class="link" href="overload3.html" title="basic_static_string::assign (3 of 9 overloads)">basic_static_string::assign 28 (3 of 9 overloads)</a> 29</h5></div></div></div> 30<p> 31 Assign to the string. 32 </p> 33<h6> 34<a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload3.h0"></a> 35 <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload3.synopsis"></a></span><a class="link" href="overload3.html#static_string.ref.boost__static_strings__basic_static_string.assign.overload3.synopsis">Synopsis</a> 36 </h6> 37<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span> 38 <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">M</span><span class="special">></span> 39<span class="keyword">constexpr</span> <span class="identifier">basic_static_string</span><span class="special">&</span> 40<span class="identifier">assign</span><span class="special">(</span> 41 <span class="keyword">const</span> <span class="identifier">basic_static_string</span><span class="special"><</span> <span class="identifier">M</span><span class="special">,</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span> <span class="special">>&</span> <span class="identifier">s</span><span class="special">,</span> 42 <span class="identifier">size_type</span> <span class="identifier">pos</span><span class="special">,</span> 43 <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> 44</pre> 45<h6> 46<a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload3.h1"></a> 47 <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload3.description"></a></span><a class="link" href="overload3.html#static_string.ref.boost__static_strings__basic_static_string.assign.overload3.description">Description</a> 48 </h6> 49<p> 50 Replaces the contents with those of the string <code class="computeroutput"><span class="identifier">sub</span></code>, 51 where <code class="computeroutput"><span class="identifier">sub</span></code> is <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">substr</span><span class="special">(</span><span class="identifier">pos</span><span class="special">,</span> <span class="identifier">count</span><span class="special">)</span></code>. 52 </p> 53<h6> 54<a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload3.h2"></a> 55 <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload3.complexity"></a></span><a class="link" href="overload3.html#static_string.ref.boost__static_strings__basic_static_string.assign.overload3.complexity">Complexity</a> 56 </h6> 57<p> 58 Linear in <code class="computeroutput"><span class="identifier">sub</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span></code>. 59 </p> 60<h6> 61<a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload3.h3"></a> 62 <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload3.exception_safety"></a></span><a class="link" href="overload3.html#static_string.ref.boost__static_strings__basic_static_string.assign.overload3.exception_safety">Exception 63 Safety</a> 64 </h6> 65<p> 66 Strong guarantee. 67 </p> 68<h6> 69<a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload3.h4"></a> 70 <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload3.template_parameters"></a></span><a class="link" href="overload3.html#static_string.ref.boost__static_strings__basic_static_string.assign.overload3.template_parameters">Template 71 Parameters</a> 72 </h6> 73<div class="informaltable"><table class="table"> 74<colgroup> 75<col> 76<col> 77</colgroup> 78<thead><tr> 79<th> 80 <p> 81 Type 82 </p> 83 </th> 84<th> 85 <p> 86 Description 87 </p> 88 </th> 89</tr></thead> 90<tbody><tr> 91<td> 92 <p> 93 <code class="computeroutput"><span class="identifier">M</span></code> 94 </p> 95 </td> 96<td> 97 <p> 98 The capacity of the other string. 99 </p> 100 </td> 101</tr></tbody> 102</table></div> 103<h6> 104<a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload3.h5"></a> 105 <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload3.return_value"></a></span><a class="link" href="overload3.html#static_string.ref.boost__static_strings__basic_static_string.assign.overload3.return_value">Return 106 Value</a> 107 </h6> 108<p> 109 <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> 110 </p> 111<h6> 112<a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload3.h6"></a> 113 <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload3.parameters"></a></span><a class="link" href="overload3.html#static_string.ref.boost__static_strings__basic_static_string.assign.overload3.parameters">Parameters</a> 114 </h6> 115<div class="informaltable"><table class="table"> 116<colgroup> 117<col> 118<col> 119</colgroup> 120<thead><tr> 121<th> 122 <p> 123 Name 124 </p> 125 </th> 126<th> 127 <p> 128 Description 129 </p> 130 </th> 131</tr></thead> 132<tbody> 133<tr> 134<td> 135 <p> 136 <code class="computeroutput"><span class="identifier">s</span></code> 137 </p> 138 </td> 139<td> 140 <p> 141 The string to replace the contents with. 142 </p> 143 </td> 144</tr> 145<tr> 146<td> 147 <p> 148 <code class="computeroutput"><span class="identifier">pos</span></code> 149 </p> 150 </td> 151<td> 152 <p> 153 The index at which to begin the substring. 154 </p> 155 </td> 156</tr> 157<tr> 158<td> 159 <p> 160 <code class="computeroutput"><span class="identifier">count</span></code> 161 </p> 162 </td> 163<td> 164 <p> 165 The size of the substring. The default argument for this parameter 166 is <a class="link" href="../npos.html" title="basic_static_string::npos"><code class="computeroutput"><span class="identifier">npos</span></code></a>. 167 </p> 168 </td> 169</tr> 170</tbody> 171</table></div> 172<h6> 173<a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload3.h7"></a> 174 <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload3.exceptions"></a></span><a class="link" href="overload3.html#static_string.ref.boost__static_strings__basic_static_string.assign.overload3.exceptions">Exceptions</a> 175 </h6> 176<div class="informaltable"><table class="table"> 177<colgroup> 178<col> 179<col> 180</colgroup> 181<thead><tr> 182<th> 183 <p> 184 Type 185 </p> 186 </th> 187<th> 188 <p> 189 Thrown On 190 </p> 191 </th> 192</tr></thead> 193<tbody><tr> 194<td> 195 <p> 196 <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">length_error</span></code> 197 </p> 198 </td> 199<td> 200 <p> 201 sub.size() > <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>. 202 </p> 203 </td> 204</tr></tbody> 205</table></div> 206</div> 207<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 208<td align="left"></td> 209<td align="right"><div class="copyright-footer">Copyright © 2019, 2020 Krystian Stasiowski<br>Copyright © 2016-2019 Vinnie 210 Falco<p> 211 Distributed under the Boost Software License, Version 1.0. (See accompanying 212 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>) 213 </p> 214</div></td> 215</tr></table> 216<hr> 217<div class="spirit-nav"> 218<a accesskey="p" href="overload2.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../assign.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="overload4.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 219</div> 220</body> 221</html> 222