this in - std_stream.h: my patch not necessary

Ryszard Kabatek rysio@rumcajs.chemie.uni-halle.de
Thu Dec 30 07:30:00 GMT 1999


On Thu, 1 Jul 1999, benjamin kosnik wrote:

> 1999-06-30  Ryszard Kabatek <kabatek@chemie.uni-halle.de>
> 
>         * bits/std_sstream.h (stringbuf::sync): Don't use
> string::begin()
>         and string::end().

I looked into my patch for std_sstream.h again
and now I think it is no more necessary...

For a call of basic_string<>::append it is not important if the string
is sharable or not, because _M_mutate only checks _M_state for > 0.

As I proposed the patch for std_sstream.h I did not know about
the problem in _M_mutate. I assumed the call of begin/end is the reason
for the reallocation, but I was wrong. 
In the old implementation of _M_mutate  any call that expands the string 
leads to reallocation, but now it is fixed. 

My proposal would work correct but it is inconvenient.
So I think the best way is to go back to the call of begin/end.


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



More information about the Libstdc++ mailing list