int foo(abc_t d) { switch (d) { case A: return 0; case B: return 1; case C: return 2; } }