basic_string - once more...

Paolo Carlini pcarlini@unitus.it
Mon Nov 12 01:02:00 GMT 2001


Stefan Olsson wrote:

> Hey!
>
> Yes, I saw that as well, but a bit later in that same thread there seems to be
> disagreement about where this should be done and I don't feel that I have enough
> knowledge (yet...) to comment on this...
>
> http://gcc.gnu.org/ml/libstdc++/2001-07/msg00086.html

As regards this part:

>_Rep::_S_create is a wrong place to do that. If one calls reserve(1024) he is
>expecting to prealloc 1024 bytes not 4096.

this is not a problem at all, if we like the implementation for other reasons. See
21.3.3.11: "After reserve the capacity is *greater* or equal..." (emphasis mine).

Cheers,
Paolo.




More information about the Libstdc++ mailing list