std::basic_ios::fail

From cppreference.com
< cpp‎ | io‎ | basic ios
bool fail() const;

Returns true if an error has occurred on the associated stream. Specifically, returns true if badbit or failbit is set in rdstate().

See ios_base::iostate for the list of conditions that set failbit or badbit.

Parameters

(none)

Return value

true if an error has occurred, false otherwise.