Could someone please explain why there is a difference in values between compile-time and run-time?

struct T
{
    int i;
    this(int a) {i=a;}
}

enum TENUM : T
{
    foo = T(2),
    bar = T(3),
}

void main()
{
    pragma(msg, TENUM.foo);    // T(2)
    pragma(msg, TENUM.bar);    // T(3)
    writeln(TENUM.foo);        // foo
    writeln(TENUM.bar);        // bar
}

Reply via email to