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: [PATCH] libstdc++/8466


On Wed, Nov 06, 2002 at 12:52:33AM +0100, Paolo Carlini wrote:

> I writ:
> 
> >Could this be done safely if basic_stringbuf could tell the Rep it was
> >being modified, so a copy would be made when the buffer is directly
> >modified?
> >If basic_stringbuf can modify the Rep directly, shouldn't it do so safely,
> >rather than trying to ensure that the string it modifies is never shared?
> >
> In principle, I agree. However, this is a *much* more invasive change 
> which I would rather
> prefer considering in a second pass through this code... Anyway, patches 
> welcome!

Having looked into it, "modifying the buffer safely" would require
overriding the basic_streambuf::sputc() member so that it modified the
internal string object through the string interface, rather than directly.
However, sputc() is non-virtual, so we can't do it, so I won't be
submitting any patches for this  :)

jon

-- 
"The optimist believes this is the best of all possible worlds,
 and the pessimist fears this is so..."
	- H. Allen Smith


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