1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>basic_static_string::assign (5 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="overload4.html" title="basic_static_string::assign (4 of 9 overloads)"> 10<link rel="next" href="overload6.html" title="basic_static_string::assign (6 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="overload4.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="overload6.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.overload5"></a><a class="link" href="overload5.html" title="basic_static_string::assign (5 of 9 overloads)">basic_static_string::assign 28 (5 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.overload5.h0"></a> 35 <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload5.synopsis"></a></span><a class="link" href="overload5.html#static_string.ref.boost__static_strings__basic_static_string.assign.overload5.synopsis">Synopsis</a> 36 </h6> 37<pre class="programlisting"><span class="keyword">constexpr</span> <span class="identifier">basic_static_string</span><span class="special">&</span> 38<span class="identifier">assign</span><span class="special">(</span> 39 <span class="identifier">const_pointer</span> <span class="identifier">s</span><span class="special">);</span> 40</pre> 41<h6> 42<a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload5.h1"></a> 43 <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload5.description"></a></span><a class="link" href="overload5.html#static_string.ref.boost__static_strings__basic_static_string.assign.overload5.description">Description</a> 44 </h6> 45<p> 46 Replaces the contents 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">traits_type</span><span class="special">::</span><span class="identifier">length</span><span class="special">(</span><span class="identifier">s</span><span class="special">))</span></code>. 47 </p> 48<h6> 49<a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload5.h2"></a> 50 <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload5.complexity"></a></span><a class="link" href="overload5.html#static_string.ref.boost__static_strings__basic_static_string.assign.overload5.complexity">Complexity</a> 51 </h6> 52<p> 53 Linear in <code class="computeroutput"><span class="identifier">count</span></code>. 54 </p> 55<h6> 56<a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload5.h3"></a> 57 <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload5.exception_safety"></a></span><a class="link" href="overload5.html#static_string.ref.boost__static_strings__basic_static_string.assign.overload5.exception_safety">Exception 58 Safety</a> 59 </h6> 60<p> 61 Strong guarantee. 62 </p> 63<h6> 64<a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload5.h4"></a> 65 <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload5.return_value"></a></span><a class="link" href="overload5.html#static_string.ref.boost__static_strings__basic_static_string.assign.overload5.return_value">Return 66 Value</a> 67 </h6> 68<p> 69 <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> 70 </p> 71<h6> 72<a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload5.h5"></a> 73 <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload5.parameters"></a></span><a class="link" href="overload5.html#static_string.ref.boost__static_strings__basic_static_string.assign.overload5.parameters">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 Name 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">s</span></code> 96 </p> 97 </td> 98<td> 99 <p> 100 A pointer to the string to copy from. 101 </p> 102 </td> 103</tr></tbody> 104</table></div> 105<h6> 106<a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload5.h6"></a> 107 <span class="phrase"><a name="static_string.ref.boost__static_strings__basic_static_string.assign.overload5.exceptions"></a></span><a class="link" href="overload5.html#static_string.ref.boost__static_strings__basic_static_string.assign.overload5.exceptions">Exceptions</a> 108 </h6> 109<div class="informaltable"><table class="table"> 110<colgroup> 111<col> 112<col> 113</colgroup> 114<thead><tr> 115<th> 116 <p> 117 Type 118 </p> 119 </th> 120<th> 121 <p> 122 Thrown On 123 </p> 124 </th> 125</tr></thead> 126<tbody><tr> 127<td> 128 <p> 129 <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">length_error</span></code> 130 </p> 131 </td> 132<td> 133 <p> 134 traits_type::length(s) > <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>. 135 </p> 136 </td> 137</tr></tbody> 138</table></div> 139</div> 140<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 141<td align="left"></td> 142<td align="right"><div class="copyright-footer">Copyright © 2019, 2020 Krystian Stasiowski<br>Copyright © 2016-2019 Vinnie 143 Falco<p> 144 Distributed under the Boost Software License, Version 1.0. (See accompanying 145 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>) 146 </p> 147</div></td> 148</tr></table> 149<hr> 150<div class="spirit-nav"> 151<a accesskey="p" href="overload4.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="overload6.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 152</div> 153</body> 154</html> 155