It is all well and good that you believe that, can you point
to a resource that specifies it may be so?
I'm not trying to troll here. I really didn't know this was
true, and I'd like to know where I can read the details of it.
I'd be more interesting in knowing what reference said anything
else. This has been the case since classical IO streams, and is
essential to know when writing your own << operators. And the
standard is quite clear about it. (Historically, many early
implementations of filebuf wouldn't necessarily give a second
EOF after sgetc() returned EOF once, at least if they were
inputting from the keyboard. So it was important that the
istream memorize the EOF, and not make any further calls to
sgetc().)
More generally, I'm curious about where so many people are
learning things like:
while ( ! std::cin.eof() ) {
// read a value and us it without further tests...
}
I can't find anything like that in any of the accepted
references (Josuttis, etc.). Josuttis says clearly that eofbit
is set if end-of-file was encountered. Not that an operation
failed. Dinkumware says the same thing. (And of course, it's
what the standard says as well.)