EnumType's stringof property returns basic type.

t.m mailto
Fri Oct 5 15:17:18 PDT 2007


import std.stdio;

enum Foo { Hoge }

template Bar(T) { const char[] Bar = T.stringof; }
template Bar2(T) {  const char[] Bar2 = (T[]).stringof; }

void main()
{
        writeln(Foo.stringof);
        writeln(Bar!(Foo));

        writeln((Foo[]).stringof);
        writeln(Bar2!(Foo));
}

======== result ========
int
int
Foo[]
Foo[]


More information about the Digitalmars-d-bugs mailing list