On Saturday, 2 January 2021 at 03:20:29 UTC, Paul Backus wrote:
D's switch statement only works on strings and integers. For more complex values, the easiest thing is to just use an if-else chain.

If you really want to use a switch statement, you can do it by defining a function that maps each of your enum values to a unique integer; for example:

Im afraid that would still result in issues when duplicate enum vlues are at play right?
(This issue would maybe warrant a compile time warning imho)

Reply via email to