public member function
Check whether either failbit or badbit is set
true if either (or both) the failbit or the badbit error state flags is set for the stream.
At least one of these flags is set when an error occurs during an input operation.
failbit is generally set by an operation when the error is related to the internal logic of the operation itself; further operations on the stream may be possible. While badbit is generally set when the error involves the loss of integrity of the stream, which is likely to persist even if a different operation is attempted on the stream. badbit can be checked independently by calling member function bad:
eofbit, failbit and badbit are member constants with implementation-defined values that can be combined (as if with the bitwise OR operator).
|indicates||functions to check state flags|
|goodbit||No errors (zero value iostate)|
|eofbit||End-of-File reached on input operation|
|failbit||Logical error on i/o operation|
|badbit||Read/writing error on i/o operation|
goodbit is zero, indicating that none of the other bits is set.
Reaching the End-of-File sets the eofbit. But note that operations that reach the End-of-File may also set the failbit if this makes them fail (thus setting both eofbit and failbit).
This function is a synonym of ios::operator!.
true if badbit and/or failbit are set.
Accesses the stream object.
Concurrent access to the same stream object may cause data races.
Strong guarantee: if an exception is thrown, there are no changes in the stream.
- Type for stream state flags (public member type)
- Check whether state of stream is good (public member function)
- Check whether badbit is set (public member function)
- Check whether eofbit is set (public member function)
- Get error state flags (public member function)
- Set error state flags (public member function)