std_sstream.h - patch

Benjamin Kosnik bkoz@cygnus.com
Tue Jun 1 12:43:00 GMT 1999


> The attached patch contains two optimizations for basic_stringbuf<>:
> 
> 1. In the default constructor I changed _M_str(__string_type()) to _M_str().
> 
> 2. In setbuf I changed the return value type and I removed the
> temporary __string_type object. Now if the new buffer length is smaller
> than the old one no reallocation is necessary.


I checked this in, thanks. I saved the dynamic_cast: it does not harm the 
generated code, is legal c++, and clarifies that a conversion from derived
to base is happening.

Thanks,
Benjamin



More information about the Libstdc++ mailing list