Interactive D?
Jarrett Billingsley
kb3ctd2 at yahoo.com
Tue Feb 26 06:34:17 PST 2008
"Oskar Linde" <oskar.lindeREM at OVEgmail.com> wrote in message
news:fq126m$enh$1 at digitalmars.com...
> Regarding stringof. The following is irritating, given:
>
> template A(T) { struct A {} }
> template B(T) { struct A {} struct B {} }
>
> A!(int) a;
> B!(int).B b;
>
> How do I reliably get the string representation of the type of a and b?
>
> There are two ways that I know of:
>
> 1. typeid(typeof(x)).toString
> 2. typeof(x).stringof
>
> The problem is that the results are:
>
> 1A: test.A!(int).A WRONG
This one is correct, as far as I can see. A!(int) a; is just sugar for
A!(int).A a;.
More information about the Digitalmars-d
mailing list