Is there a way to get the compiler to warn if an integer is outside the 'range' of an enum
? For example, something like this:
enum Brothers {Snee, Snoo, Snum};
int main(void) {
enum Brothers k;
k = Snee;
k = 9; // compiler warning for an int outside [0,2] ?
}