while there are solutions to easily convert an enum to a string, I would like the extra safety benefits of using enum class
. Is there a simple way to convert an enum class
to a string?
(The solution given doesn't work, as enum class can't index an array).