It’s long, long past time for C/C++ to have some automated way to reflect enums and/or build enums from strings. ARRRRGGHHH! SO MUCH DUPLICATION OF DATA! (And I hope you spotted the [most egregious] mistake). Firstly, it’s time for enums to become printable. [sourecode language='cpp'] enum class ProductType { Whine, Cheese, Max } ; … [...]