This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: libstdc++/9424: i/ostream::operator>>/<<(streambuf*) drops characters
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