31 points | by Tsche a day ago ago
2 comments
In D, you can just do a static foreach over a sequence to generate case labels:
https://d.godbolt.org/z/PxWEW14K1
I find the article very interesting and informative but, honestly, of all of the approaches, I find the basic switch to be the most readable and likely the most maintainable, at least for this case.
In D, you can just do a static foreach over a sequence to generate case labels:
https://d.godbolt.org/z/PxWEW14K1
I find the article very interesting and informative but, honestly, of all of the approaches, I find the basic switch to be the most readable and likely the most maintainable, at least for this case.