public member function
<ios> <iostream>


bool eof() const;
Check whether eofbit is set
Returns true if the eofbit error state flag is set for the stream.

This flag is set by all standard input operations when the End-of-File is reached in the sequence associated with the stream.



Return Value

true if the stream's eofbit error state flag is set (which signals that the End-of-File has been reached in an input operation).
false otherwise.

Data races

Accesses the stream object.
Concurrent access to the same stream object may cause data races.

Exception safety

Strong guarantee: if an exception is thrown, there are no changes in the stream.

See also