#include <iostream>
#include <inttypes.h>
enum MyEnum {Test, Enum, Flags};
union BitField
{
unsigned int one : 16;
MyEnum two : 8;
signed int three : 7;
bool four : 1;
};
int main()
{
std::cout << "sizeof(BitField) == " << sizeof(BitField) << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW50dHlwZXMuaD4KCmVudW0gTXlFbnVtIHtUZXN0LCBFbnVtLCBGbGFnc307Cgp1bmlvbiBCaXRGaWVsZAp7CiAgICB1bnNpZ25lZCBpbnQgb25lIDogMTY7CiAgICBNeUVudW0gdHdvIDogODsKICAgIHNpZ25lZCBpbnQgdGhyZWUgOiA3OwogICAgYm9vbCBmb3VyIDogMTsKfTsKICAgICAgICAKaW50IG1haW4oKQp7CiAgICBzdGQ6OmNvdXQgPDwgInNpemVvZihCaXRGaWVsZCkgPT0gIiA8PCBzaXplb2YoQml0RmllbGQpIDw8IHN0ZDo6ZW5kbDsKICAgIAogICAgcmV0dXJuIDA7Cn0=