libstdc++: Document when std::string::shrink_to_fit was added

This section can be misread to say that shrink_to_fit is available from
GCC 3.4, but it was added later.

libstdc++-v3/ChangeLog:

	* doc/xml/manual/strings.xml: Clarify that GCC 4.5 added
	std::string::shrink_to_fit.
	* doc/html/manual/strings.html: Regenerate.
This commit is contained in:
Jonathan Wakely 2024-05-14 14:28:21 +01:00
parent b7003b4cc5
commit 0a99ad5c52
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View File

@ -269,8 +269,8 @@ stringtok(Container &container, string const &in,
(see <a class="link" href="../faq.html#faq.size_equals_capacity" title="7.8.">this FAQ
entry</a>) but the regular copy constructor cannot be used
because libstdc++'s <code class="code">string</code> is Copy-On-Write in GCC 3.
</p><p>In <a class="link" href="status.html#status.iso.2011" title="C++ 2011">C++11</a> mode you can call
<code class="code">s.shrink_to_fit()</code> to achieve the same effect as
</p><p>From GCC 4.5 in <a class="link" href="status.html#status.iso.2011" title="C++ 2011">C++11</a> mode you
can call <code class="code">s.shrink_to_fit()</code> to achieve the same effect as
<code class="code">s.reserve(s.size())</code>.
</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="strings.string.Cstring"></a>CString (MFC)</h3></div></div></div><p>
</p><p>A common lament seen in various newsgroups deals with the Standard

View File

@ -356,8 +356,8 @@ stringtok(Container &amp;container, string const &amp;in,
entry</link>) but the regular copy constructor cannot be used
because libstdc++'s <code>string</code> is Copy-On-Write in GCC 3.
</para>
<para>In <link linkend="status.iso.2011">C++11</link> mode you can call
<code>s.shrink_to_fit()</code> to achieve the same effect as
<para>From GCC 4.5 in <link linkend="status.iso.2011">C++11</link> mode you
can call <code>s.shrink_to_fit()</code> to achieve the same effect as
<code>s.reserve(s.size())</code>.
</para>