This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: basic_string - once more...


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]