libstdc++/9424: i/ostream::operator>>/<<(streambuf*) drops characters

Martin Sebor sebor@roguewave.com
Sat Mar 8 00:57:00 GMT 2003


Nathan Myers wrote:
...
> 
>   __xtrct = __charsread = 0;
>   while (true)
>     {
>       int_type __c = __sbin->sbumpc();
>       if (_Traits::eq_int_type(__c ), _Traits_type::eof())
>       	break;
>       ++__charsread;
>       __c = __sbout->sputc(__c);
>       if (_Traits::eq_int_type(__c, _Traits_type::eof()))
>       	break;

I might be missing some context, so please forgive me if I'm off
base, but wouldn't 27.6.2.5.3, p7, bullet 2 seem to preclude this
implementation since the character must not be extracted if the
insertion fails?

Regards
Martin



More information about the Libstdc++ mailing list