enum class Thing {
FOO = 0x01,
BAR = 0x02
};
Thing thing = Thing::FOO | Thing::BAR; // doesn't compile This is an age old problem. What is the proper way to achieve what I'm trying to do here? As far as I can tell, using enum class is more a hindrance than a useful tool with flags. I end up typing less with a normal enum:
enum Thing {
FOO = 0x01,
BAR = 0x02
};
unsigned char thing = FOO | BAR;