std::basic_ios<CharT,Traits>::clear (3) - Linux Manuals
std::basic_ios<CharT,Traits>::clear: std::basic_ios<CharT,Traits>::clear
NAME
std::basic_ios<CharT,Traits>::clear - std::basic_ios<CharT,Traits>::clear
Synopsis
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.
Parameters
state - badbit irrecoverable stream error
Return value
(none)
Exceptions
This section is incomplete
Reason: link to basic_ios::exceptions, too
Example
clear() without arguments can be used to unset the failbit after unexpected input
// Run this code
See also
setstate (public member function)
rdstate (public member function)