Hello!
Since I guess there's no enumeration method for creating bit mask constants, I have created a macro:
What do you think of it? I don't understand why there wasn't a bit mask enumeration method built in to the language from the beginning, it could have been useful.Code:#define BM_ENUM(x) \ x##_ENUM_IDX, \ x = 1 << x##_ENUM_IDX, \ x##_ENUM_IDX_AGAIN = x##_ENUM_IDX enum TestBitmask { BM_ENUM(FIRST), BM_ENUM(SECOND), BM_ENUM(THIRD), BM_ENUM(FOURTH) };