From b84070e7bdf1e3666953d008f30f2b7472d9174c Mon Sep 17 00:00:00 2001
From: Jonathan Wakely
Date: Tue, 14 May 2024 14:28:21 +0100
Subject: [PATCH] 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.
(cherry picked from commit 0a99ad5c52caa06c113b1889bbe6634812b89be5)
---
libstdc++-v3/doc/html/manual/strings.html | 4 ++--
libstdc++-v3/doc/xml/manual/strings.xml | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/libstdc++-v3/doc/html/manual/strings.html b/libstdc++-v3/doc/html/manual/strings.html
index ceb09f97eac4..34a34dfa980c 100644
--- a/libstdc++-v3/doc/html/manual/strings.html
+++ b/libstdc++-v3/doc/html/manual/strings.html
@@ -269,8 +269,8 @@ stringtok(Container &container, string const &in,
(see this FAQ
entry) but the regular copy constructor cannot be used
because libstdc++'s string is Copy-On-Write in GCC 3.
-
In C++11 mode you can call
- s.shrink_to_fit() to achieve the same effect as
+
From GCC 4.5 in C++11 mode you
+ can call s.shrink_to_fit() to achieve the same effect as
s.reserve(s.size()).
CString (MFC)
A common lament seen in various newsgroups deals with the Standard
diff --git a/libstdc++-v3/doc/xml/manual/strings.xml b/libstdc++-v3/doc/xml/manual/strings.xml
index b0dab645a2d9..4a63dd964771 100644
--- a/libstdc++-v3/doc/xml/manual/strings.xml
+++ b/libstdc++-v3/doc/xml/manual/strings.xml
@@ -356,8 +356,8 @@ stringtok(Container &container, string const &in,
entry) but the regular copy constructor cannot be used
because libstdc++'s string is Copy-On-Write in GCC 3.
- In C++11 mode you can call
- s.shrink_to_fit() to achieve the same effect as
+ From GCC 4.5 in C++11 mode you
+ can call s.shrink_to_fit() to achieve the same effect as
s.reserve(s.size()).
--
2.47.2