I currently have a set of enums being used as flags
enum Flags {
Flag1 = 1
Flag2 = 2
Flag3 = 4
Flag4 = 8
};
So on and so forth. I'm then using an inline to make it so the |
to allow them to be combined. Using this system I can then check for independent flags using simple if statements.
Printing combined flags in this manner produces their sum, ie: Flag2 | Flag4
would produce 10
.
My question is if there's a way to list all of the flags currently assigned to something as independent ints instead of their combined sum.
How about this?