explicit operator bool() const;
Returns: !fail().
Returns: fail().
Returns: The error state of the stream buffer.
void clear(iostate state = goodbit);
Postcondition: If rdbuf()!=0 then state == rdstate(); otherwise rdstate()==(state | ios_base::badbit).
Effects: If ((state | (rdbuf() ? goodbit : badbit)) & exceptions()) == 0, returns. Otherwise, the function throws an object fail of class basic_ios::failure ([ios::failure]), constructed with implementation-defined argument values.
Effects: Calls clear(rdstate() | state) (which may throw basic_ios::failure ([ios::failure])).
Returns: rdstate() == 0
Returns: true if eofbit is set in rdstate().
Returns: true if badbit is set in rdstate().
Returns: A mask that determines what elements set in rdstate() cause exceptions to be thrown.
void exceptions(iostate except);
Postcondition: except == exceptions().
Effects: Calls clear(rdstate()).
Checking badbit also for fail() is historical practice.