SysTutorials

Linux Manual Pages › Section 3

stdios_baseiostate(3)

std::ios_base::iostate - std::ios_base::iostate

Synopsis

typedef /*implementation defined*/ iostate;
static constexpr iostate goodbit = 0;
static constexpr iostate badbit = /*implementation defined*/
static constexpr iostate failbit = /*implementation defined*/
static constexpr iostate eofbit = /*implementation defined*/

Specifies stream state flags. It is a BitmaskType, the following constants are defined: Constant Explanation goodbit no error badbit irrecoverable stream error failbit input/output operation failed (formatting or extraction error) eofbit associated input sequence has reached end-of-file

The eofbit

The eofbit is set by the following standard library functions:

The following functions clear eofbit as a side-effect:

Note that in nearly all situations, if eofbit is set, the failbit is set as well.

The failbit

The failbit is set by the following standard library functions:

The badbit

The badbit is set by the following standard library functions:

rdbuf()->sputbackc() or rdbuf()->sungetc() return traits::eof().

Example

 This section is incomplete  Reason: no example

See also

The following table shows the value of basic_ios accessors (good(), fail(), etc.) for all possible combinations of ios_base::iostate flags: ios_base::iostate flags basic_ios accessors eofbit failbit badbit good() fail() bad() eof() operator_bool operator! false false false true false false false true false false false true false true true false false true false true false false true false false false true false true true false true true false false true true false false false false false true true false true false true false true true true false true true true false false true false true false true true true true false true true true false true          returns state flags rdstate (public member function of std::basic_ios<CharT,Traits>)          sets state flags setstate (public member function of std::basic_ios<CharT,Traits>)          modifies state flags clear (public member function of std::basic_ios<CharT,Traits>)