Jonathan M Davis <[email protected]> wrote:

Is it not presently possible to use structs for enums

I believe this is the case, yes.

There are ways to do things that are similar, of course:

struct E { //Namespace, as D lacks those
    struct S {
        this( string phrase, int num ) {
            this.phrase = phrase;
            this.num = num;
        }
        string phrase;
        int    num;
    }
    enum a = S("hello", 1);
    enum b = S("goodbye", 45);
    enum c = S("world", 22);
}

--
Simen

Reply via email to