std::basic_ios<CharT,Traits>::clear (3) - Linux Man Pages
void clear( std::ios_base::iostate state = std::ios_base::goodbit );
Sets the stream error state flags by assigning them the value of state. By default, assigns std::ios_base::goodbit which has the effect of clearing all error state flags.
If rdbuf() is a null pointer (i.e. there is no associated stream buffer), then state | badbit is assigned. May throw an exception.
state - badbit irrecoverable stream error
This section is incomplete
Reason: link to basic_ios::exceptions, too
clear() without arguments can be used to unset the failbit after unexpected input
// Run this code
setstate (public member function)
rdstate (public member function)