Alexandr Druzhinin:
but I don't think it is elegant
If you think that's not elegant, then try to do the opposite: instead of giving the full mymap in the static this, try to create it from the elements of the enum itself.
In D the enum name is better starting with an upper case, and the end semicolon is not needed:
enum Foo { one, three, seven }
Bye,
bearophile
