import std.stdio;
void foo(Callable)(Callable bar) { bar(); } void foo2(Callable)(Callable bar, int baz) { bar(baz); } void main() { foo({ writeln("okay"); }); foo2((bar) { writeln("got",bar); },42); foo2((bar) => writeln("yay",bar), 42); }
import std.stdio;
void foo(Callable)(Callable bar) { bar(); } void foo2(Callable)(Callable bar, int baz) { bar(baz); } void main() { foo({ writeln("okay"); }); foo2((bar) { writeln("got",bar); },42); foo2((bar) => writeln("yay",bar), 42); }