Hello,
I need to declare a static compile-time assoc array inside struct:
    struct Test
    {
        enum Type : ubyte
        {
            One,
            Two,
            Three
        }

static immutable string[Type] DESCRIPTION = [Type.One: "One!", Type.Two: "It's Two...", Type.Three: "And... Three!"];
    }

I have an error: "non-constant expression". What should I do?

I want to declare it and init at compile-time (to reduce run-time overhead). After that it will be used in run-time expressions and in compile-time expressions.

Regards, Andrey.

Reply via email to