Namespaces
Variants
Views
Actions

std::basic_ios::good

From cppreference.com
< cpp‎ | io‎ | basic ios
Revision as of 12:27, 29 July 2013 by Cubbi (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
bool good() const;

Returns true if the the most recent I/O operation on the stream completed successfully. Specifically, returns result of rdstate() == 0.

See ios_base::iostate for the list of conditions that set the stream status bits.

Contents

[edit] Parameters

(none)

[edit] Return value

true if the stream has no errors occurred, false otherwise.

[edit] Example

[edit] 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