This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: this in - std_stream.h: my patch not necessary
- To: benjamin kosnik <bkoz@nabi.net>
- Subject: Re: this in - std_stream.h: my patch not necessary
- From: Ryszard Kabatek <rysio@rumcajs.chemie.uni-halle.de>
- Date: Thu, 1 Jul 1999 19:05:11 +0200 (CEST)
- cc: libstdc++@sourceware.cygnus.com
- Reply-To: Ryszard Kabatek <kabatek@chemie.uni-halle.de>
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