bug with is(T == TI!TP) expression: captures templated structs but not templated functions?

Timothee Cour thelastmammoth at gmail.com
Tue Jun 25 03:32:01 PDT 2013


template Test(alias T){
  static if(is(T == TI!TP, alias TI, TP)){
    enum Test=true;
  }
  else{
    enum Test=false;
  }
}

struct A(T){}
void foo(T)(T a){}

void main(){
  static assert(Test!(A!double));
  static assert(!Test!(foo!double)); //why is Test false?
}

This is blocking my pull request to make
fullyQualifiedName/GetTemplateParent/GetTemplateArguments work on
everything: right now it fails on templated functions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130625/f013423a/attachment.html>


More information about the Digitalmars-d mailing list