On Friday, 19 February 2016 at 05:41:01 UTC, jmh530 wrote:
I'm trying to write a function that will adjust the parameters of a function pointer.
I think the problem is that it defaults to a delegate not that it cannot be one
does clarifying this to the compiler work Like
alias fp1 = int function(int x); alias fp2 = int function(int x, int y); auto foo(T)(T f) { static if (is(T == fp2)) return f; else static if (is(T == fp1)) { return int function(int x, int y) => f(x); } else return 0; }
?