On Thursday, 10 April 2014 at 14:37:37 UTC, Meta wrote:
On Thursday, 10 April 2014 at 04:47:31 UTC, Walter Bright wrote:
It makes perfect sense if you think of an enum as an integral type, some values of which have names, as in the "Color" example I posted earlier.

I do not wish to think of enums in this way. Your use-case is better solved with Typedef and a struct.

Me neither. An enumeration should exactly do this: enumerate each of it's possible values. If you like to do arithmetics on it, it's something different. Especially flags and colors are NOT enumerated - you give only some names for some edge cases. So why not call it such: "named examples" and make it a differnt type, where arithmetic is allowed and "final switch" is not (like for int)? Especially this is what is really annoing, and a "default" case is not even allowed in a final switch - so it should also not be possible to construct illegal values other than by explicit unsave operations (like cast).

Reply via email to