Shouldn't the first flag value be set to 1 (1 << 0) instead of 2 (1 << 1) ?
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.
| 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.