Walter Bright: > void foo(alias f)() > { > f(3, 4); > } > foo!((x,y){return x * y;))();
I have tried: import std.stdio: writeln; void foo(alias f)() { f(3, 4); } void main() { foo!( (x, y) { writeln(x * y); } )(); } And it works, printing 12 :-) Very cute. This is able to simplify some of the code of (D1) dlibs :-) I didn't even know that lambda delegates in D2 can now infer the type of their input argument, so you can use (x, y) instead of (int x, int y). Can you tell me when this was changed? :-) Bye, bearophile