http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46624

MyAdEss at seznam dot cz changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #2 from MyAdEss at seznam dot cz 2010-11-23 20:01:30 UTC ---
(In reply to comment #1)
> I don't see a requirement in the standard for the behaviour you expect.
> 
> istream::sync() calls streambuf::sync(), the behaviour of which depends on the
> specific streambuf type.  Since the type of streambuf used by std::cin is
> unspecified, the behaviour of cin.sync() is also unspecified.

Oh, I guess you are right. Standard doesn't specify behaviour for cin's
streambuf type. It is implementation-specific. It worked for me on different
platforms and compilers. I was also reading it's definition on cplusplus.com
but I should look what standard says.
Anyway, it would be nice if it worked as I expected. cin.ignore() statements
inside loops could be avoided.

Thank you for your fast reply.

Reply via email to