There are many ways, like (untested):

AA.keys.sort().equals([EnumMembers!MyEnum].sort())

Seems to work:

import std.algorithm, std.traits;

enum Foo { one, three, seven};
static int[Foo] myMap;

static this() {
    with (Foo)
        myMap = [
            one: 1,
            three: 3,
            seven: 7
        ];
    assert(myMap.keys.sort().equal([EnumMembers!Foo].sort()));
}

void main() {}

Bye,
bearophile

Reply via email to