[RFC] Default constructed stringbufs and stringstreams

Paolo Carlini pcarlini@suse.de
Wed Sep 29 08:43:00 GMT 2004


Nathan Myers wrote:

>I believe that the design of stringbuf is under review for the next
>standard.  Probably the requirement that it be in an unusable state
>upon creation will be relaxed.
>  
>
I see... However, I disagree with "unusable": having the get/put pointers
null upon creation by the default-constructor has no negative implications
for the behavior of the streambuf inlines. Also, "fixing" this problem would
bring consistency with a default constructed filebuf and doesn't make the
code more complex, I gonna show you a patch later today...

Moreover, forgot about the initial motivation ;), we could avoid using
_M_string.capacity() in the tests on top os seekoff/seekpos, something
definitely *not* non-zero-room-in-a-default-constructed-string friendly...

Paolo.



More information about the Libstdc++ mailing list