On Sunday, 24 November 2013 at 13:58:11 UTC, Philippe Sigaud wrote:
You can use CTFE and an initializing function. It's a bit cumbersome,but it works.
Lambda's to the rescue! //---- enum string[int][string] pohodEnumValues = (){ string[int][string] result; result["vid"] = [ 3: "skiing", 5: "rafting", 7: "jumping" ]; result["ks"] = [ 1: "first", 2: "second", 3: "third" ]; result["prepare"] = [ 1:"planning", 3:"preparing", 5:"complete" ]; return result; }(); //---- This is cleaner, IMO.