void print_stream_state( const StreamType &stream ) { cout << "good: " << stream.good() << endl; cout << "eof: " << stream.eof() << endl; cout << "fail: " << stream.fail() << endl; cout << "bad: " << stream.bad() << endl; cout << bitset<4>(stream.rdstate()).to_string() << endl; }
bool bad_stream( const StreamType &stream ) { return (stream.fail() || stream.bad()); }