Possible Duplicate:
How to know if the next character is EOF in C++
I want to find out whether or not some istream has reached to the end of file.
Something like
if (my_istream.peek() == EOF) {...}
The documentation advice to use traits::eof()
. How do I do that? I don't understand.