On Sat, Jun 22, 2013 at 5:07 PM, anonymous <anonymous@example.com> wrote:
On Saturday, 22 June 2013 at 23:57:17 UTC, Timothee Cour wrote:
template getTemplate(T : TI!TP, alias TI, TP...)
{
alias getTemplate = TI;
}


however, indeed seems to work with types only, not functions.

Just add another overload (is that the correct term?) with alias T:

template getTemplate(alias T : TI!TP, alias TI, TP...)
{
alias getTemplate = TI;
}

did you test it? doesn't work for me:

auto fun(T)(T x){return x;}
pragma(msg,__LINE__,":",getTemplate!(fun!double));

Error: template instance getTemplate!(fun) does not match template declaration getTemplate(alias T : TI!(TP), alias TI, TP...)