Enums for array indexing

What do you mean with dynamic dispatching? All the state enums would be of the same type, namely States.

The purpose of Enum is to use types and rely on dispatch

I disagree, the purpose of an enum is to be an element in a finite discrete space. Seems to me exactly what OP is intending to use it for.

3 Likes