4 ms·
As an optional implementation that'd be nice, but this syntax I assume is meant to solve two problems: 1. Making the integral values of an enum clear and uncha
by famousactress 13y ago
As an optional implementation that'd be nice, but this syntax I assume is meant to solve two problems:
1. Making the integral values of an enum clear and unchanged by re-ordering the names. If the integral values matter to you (because you serialize enums that way), then I would want them to be explicit.
2. The integer values of these enums aren't exclusive. Two enums can reference the same value.
That said, I agree a short hand for people who don't care seems reasonable, where the integers could be auto-assigned by definition order, or just all set to 0.