This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/10444: ifstream.peek() can remove a character from the input file stream
- From: paolo at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, loren dot williams at lycos dot com, nobody at gcc dot gnu dot org, paolo at gcc dot gnu dot org
- Date: 20 Apr 2003 10:34:03 -0000
- Subject: Re: c++/10444: ifstream.peek() can remove a character from the input file stream
- Reply-to: paolo at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, loren dot williams at lycos dot com, nobody at gcc dot gnu dot org, paolo at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
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