2 ms·
Wouldn't that mean that you should just define ERROR as the first enumeration constant, with value 0, rather than break out of the enum type? It's really commo
by naruhodo 3y ago
Wouldn't that mean that you should just define ERROR as the first enumeration constant, with value 0, rather than break out of the enum type?
It's really common though to use enums as array indices, which start at 0.
- dwattttt 3y agoIn practice I always choose the first enumeration to be a specific error of "you failed to initialise this". I don't know that I've ever directly used an enum as an index, but I guess if I did I'd have to bias it.