On Sat, Jun 22, 2013 at 5:24 PM, anonymous <anonymous@example.com> wrote:
On Sunday, 23 June 2013 at 00:18:23 UTC, Timothee Cour wrote:
On Sat, Jun 22, 2013 at 5:07 PM, anonymous <anonymous@example.com> wrote:
[...]
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...)

Oh, sorry. I had tested it with generic templates and assumed it would work with everything that's not a type. No ideas on how to make it work with function templates then.


there's also this case:
template E8(T){
struct B{}
struct A{}
}

pragma(msg,__LINE__,":",getTemplate!(E8!(float))); => works with template getTemplate(alias T : TI!TP, alias TI, TP...) specialization

pragma(msg,__LINE__,":",getTemplate!(E8!(float).A)); =>  ??
how to make the 2nd work?

is there something like: 
template getTemplate(alias T : TI!TP.TE, alias TI, alias TE, TP...) {...} 
available ?