About clear(). Please help!
I recently learnt from C++ Primer 4th Edition that
Quote:
8.2. Condition States
... ...
s.clear(flag): Set specified condition state(s) in s to valid state. Type of flag is strm::iostate.
... ...
cin.clear(istream::failbit); // clear the failbit state
... ...
But it turns out that clear sets the condition states according to flag, that's, after clear is called, the condition states is equal to flag.
Does it mean that the author is wrong?
Or is it in the new standard, if any, that clear is used to set specified condition states to valid?
When I refered to C++ Primer 3rd Edition, I found that
Quote:
20.7 Condition States
... ...
Using the clear() member function, we reset the condition state to an explicit value.
... ...
I'm really very confused now!