The second function version sets a new exception mask and calls clear(rdstate()).
The exception mask is an internal value of all stream objects specifying which state flags have to throw an exception when they are set. This mask is an object of type ios_base::iostate, which is a value formed by any combination of the following member constants:
|eofbit||End-Of-File reached while performing an extracting operation on an input stream.|
|failbit||The last input operation failed because of an error related to the internal logic of the operation itself.|
|badbit||Error due to the failure of an input/output operation on the stream buffer.|
|goodbit||No error. Represents the absence of all the above (the value zero).|
More than a single state flag bit can be combined into a single bitmask by using the bitwise OR operator (|). By default, stream objects have a goodbit exception mask, which means no exceptions are thrown when any of the state flags is set.
- A bitmask value of type ios_base::iostate formed by a combination of error state flag bits to be set (badbit, eofbit, failbit).
Return ValueA bitmask of type ios_base::iostate representing the existing exception mask before the call to this member function.
Basic template member declaration( basic_ios<charT,traits> )
|ios::rdstate||Get error state flags (public member function)|