c++/10444: ifstream.peek() can remove a character from the input file stream
paolo@gcc.gnu.org
paolo@gcc.gnu.org
Sun Apr 20 10:34:00 GMT 2003
Synopsis: ifstream.peek() can remove a character from the input file stream
Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-By: paolo
Responsible-Changed-When: Sun Apr 20 10:34:03 2003
Responsible-Changed-Why:
Triaged.
State-Changed-From-To: open->closed
State-Changed-By: paolo
State-Changed-When: Sun Apr 20 10:34:03 2003
State-Changed-Why:
Not a bug. The problem is not with peek() but, honestly,
with your understanding of operator>>(char&): at variance
with get(), it skips any initial whitespace before
extracting the char. In fact, changing onegm.txt to:
A_______0.0856
B_______0.0139
C_______0.0279
leads to the behaviour that you expect.
Thanks for your report, Paolo.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10444
More information about the Gcc-prs
mailing list