]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Document when std::string::shrink_to_fit was added
authorJonathan Wakely <jwakely@redhat.com>
Tue, 14 May 2024 13:28:21 +0000 (14:28 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 9 Jan 2025 23:52:31 +0000 (23:52 +0000)
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.

(cherry picked from commit 0a99ad5c52caa06c113b1889bbe6634812b89be5)

libstdc++-v3/doc/html/manual/strings.html
libstdc++-v3/doc/xml/manual/strings.xml

index ceb09f97eac4043db9c7622e222bc9d4b69ab0eb..34a34dfa980c84973bc5cb749b09e7f4b9449504 100644 (file)
@@ -269,8 +269,8 @@ stringtok(Container &amp;container, string const &amp;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
index b0dab645a2d9f1924dc274f960fda759797913b1..4a63dd964771ff85799e0f5e5147dc65139e7128 100644 (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>