Both template functions should work, but doesn't.
template gc_free1(T)
{
alias Type = T*;
void gc_free1(Type data) {}
}
template gc_free2(T) if (!is(T == class))
{
alias Type = T*;
void gc_free2(Type data) {}
}
void main()
{
int* p;
gc_free1!int(p); // OK
gc_free2!int(p); // Error: undefined identifier Type
}
Still doesn't work:
temcons.d(17): Error: template instance `temcons.gc_free2!int` does not match template declaration `gc_free2(T)(Type data)`
And you can't even alias the template instance:
alias a = gc_free2!int; // same error