Cannot access template name from within template

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 3 15:28:46 PDT 2016


Consider:

template SomethingCool(alias X) { alias Y = X!int; }

struct MyStruct(T) {
     alias A = SomethingCool!MyStruct;
}

Inside MyStruct though, a mention of the symbol MyStruct alone is 
actually the current instantiation - i.e. a type, not a template.

Any known workaround?


Thanks,

Andrei


More information about the Digitalmars-d mailing list