[Issue 966] is(H==function) fails if H is a function type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Aug 12 20:10:37 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=966


bugzilla at digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Comment #2 from bugzilla at digitalmars.com  2007-08-12 22:10 -------
That's because &fun is not a function type, it's a pointer to a function.
Rewrite the template as:

bool isfun(H)( H h){
  static if (is( H F == F*) && is(F == function ))
    return true;
  else
    return false;
}

and it will work.


-- 



More information about the Digitalmars-d-bugs mailing list