mask in enum [C++] -
I'm playing with bits this time and I'm looking at Microsoft code for IO states and looking for something like this :
enum _Iostate {// stream states for static _Statmask = 0x17}; // what is this mask ??? Constant const_Iostate goodbit = (_Iostate) 0x0; Static const _Iostate eofbit = (_Iostate) 0x1; Static const _Iostate failbit = (_Iostate) 0x2; Static const_Iostate badbit = (_Iostate) 0x4; Constant const _Iostate _Hardfail = (_Iostate) 0x10;
I wonder why this is a mask because the code works without this mask and the values remain the same as the mask. Thank you.
ensures that the correct size of _Iostate
enum is defined later To hold all the bit constant, and their combination.
Comments
Post a Comment