Let this() figure out T implicitly?

Timon Gehr timon.gehr at gmx.ch
Fri Feb 17 05:38:38 PST 2012


On 02/17/2012 02:07 PM, Kevin Cox wrote:
> Yes.  At least as the compiler would say.  It's a little odd but I
> believe that is how the D Nam mangling works.  I personally just think
> of Foo!(Class) as the type.
>

class Foo(T){ ... }

Is syntactic sugar for

template Foo(T){
     class Foo{ ... }
}

Therefore the type is Foo!(Class).Foo. I'd prefer the compiler to output 
Foo!(Class) in error messages and for .stringof though, vote here:

http://d.puremagic.com/issues/show_bug.cgi?id=7064


More information about the Digitalmars-d-learn mailing list