[PATCH] Fix basic_string::reserve bug PR4548

Paolo Carlini pcarlini@unitus.it
Mon Nov 12 10:05:00 GMT 2001


(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.




More information about the Libstdc++ mailing list