Re: Function signature testing with is expression.

2017-12-17 Thread Alexandru Ermicioi via Digitalmars-d-learn
On Sunday, 17 December 2017 at 16:19:00 UTC, ag0aep6g wrote: On Sunday, 17 December 2017 at 14:44:15 UTC, Alexandru Ermicioi wrote: Suppose: struct F { static void foo(T)(T i, int o) {} } enum bool check(T) = is(F.foo!T == void function(Z, int), Z); enum correct = check!int;

Re: Function signature testing with is expression.

2017-12-17 Thread ag0aep6g via Digitalmars-d-learn
On Sunday, 17 December 2017 at 14:44:15 UTC, Alexandru Ermicioi wrote: Suppose: struct F { static void foo(T)(T i, int o) {} } enum bool check(T) = is(F.foo!T == void function(Z, int), Z); enum correct = check!int; Upon running it will return false, though, by logic is

Re: Function signature testing with is expression.

2017-12-17 Thread Ali Çehreli via Digitalmars-d-learn
On 12/17/2017 06:44 AM, Alexandru Ermicioi wrote: > It is interesting that it will not work with global functions as well: > > > void foo(int i, double d) {}; > enum bool check = is(typeof(foo) == void function(int, double)); > There, the address-of operator is missing. This