This is the mail archive of the libstdc++@sourceware.cygnus.com 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]

Re: basic_string<>::_M_mutate


On Mon, 12 Jul 1999, Benjamin Kosnik wrote:

> 
> This and the operator+ stuff in.

You modified my patches a bit, I think my versions was better :-) 

In in my version of _M_mutate _M_state was set to 0 
either automaticly by creating of new _Rep object in 'if block'
or explicit in 'else block'. 
Now if a new _Rep object is created _M_state will be set to 0 again 
at the end of _M_mutate - it is not necessary.

In operator+(_CharT __lhs, const basic_string<>& __rhs)
You did
__str.reserve(__len + sizeof(_CharT));

- reserve takes a number of char_type objects, not bytes, so that

__str.reserve(__len + 1);

is enough.


Ryszard Kabatek
Martin-Luther University Halle-Wittenberg, Department of Physical Chemistry
Geusaer Str. 88, 06217 Merseburg, Germany
Tel. +49 3461 46 2466 Fax. +49 3461 46 2129


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