public member type
<ios> <iostream>

std::ios_base::iostate

Type for stream state flags
Bitmask type to represent stream error state flags.

All stream objects keep information on the state of the object internally. This information can be retrieved as an element of this type by calling member function basic_ios::rdstate or set by calling basic_ios::setstate.

The values passed and retrieved by these functions can be any valid combination (using the boolean OR operator, "|") of the following member constants:


flag valueindicates
eofbitEnd-Of-File reached while performing an extracting operation on an input stream.
failbitThe last input operation failed because of an error related to the internal logic of the operation itself.
badbitError due to the failure of an input/output operation on the stream buffer.
goodbitNo error. Represents the absence of all the above (the value zero).

These constants are defined in the ios_base class as public members. Therefore, they can be referred to either directly by their name as ios_base members (like ios_base::badbit) or by using any of their inherited classes or instantiated objects, like for example ios::eofbit or cin.goodbit.

See also