This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Fix basic_string::reserve bug PR4548
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: Paolo Carlini <pcarlini at unitus dot it>, libstdc++ at gcc dot gnu dot org
- Cc: bkoz at redhat dot com
- Date: Tue, 20 Nov 2001 22:48:05 +0100
- Subject: Re: [PATCH] Fix basic_string::reserve bug PR4548
- References: <3BF6D7F0.755ED0F0@unitus.it>
(unpolitely replying to myself only to add a missing pointer to the Standard)
> In a nutshell (see below for details), currently, when a given string is shared
> basic_string::reserve does not adjust the requested value for its capacity()
> to a final value in any case >= the current size(). This is very bad :)
[lib.string.capacity] 21.3.3.11 (also, Josuttis pag. 486, 510, in particular "The capacity
is never reduced below the current number of characters")
Cheers,
Paolo.