The isSet function returns true if any of the flags is set, not all the flags are set. Is this the intended behaviour ? Should we rename it to isAnySet ?
There is a way to specify that an enum must be of a specific integer type (might be c++11). But it doesn't help with the compiler error. Using ( 1u << 31 ) seems to work.
1 2 3 4 5 6 7 | enum sim_entity_flags : uint32 { EntityFlag_Collides = (1 << 1), EntityFlag_Nonspatial = (1 << 2), EntityFlag_Simming = (1u << 31), }; |
Edit: the combination of the two seems to work.