Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
goodbit stream state
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="James Kanze, post: 3050818"] [...] Most importantly: despite its name, goodbit is not a bit. Basically, iostate is a "bitmask" type; an implementation defined type which can be thought of as a set of bits. badbit, failbit, and eofbit are constants which, when or'ed with an iostate, set the corresponding bit. Logically, they can be thought of as names for the bit, but of course, they too are of type iostate, corresponding to values with a single bit set. goodbit is a special value in which has no bits set, which can be used to say that you don't want any bits set. Thus, in an operator>>, to set the iostate to failbit, you might write: dest.clear( std::ios::failbit ) ; , to set both failbit and eofbit: dest.clear( std::ios::failbit | std::ios::eofbit ) ; and to reset all of the bits: dest.clear( std::ios::goodbit ) ; (which is the default value of the argument). [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
goodbit stream state
Top