static int fun(int a=1, int b=2, int c=3, int d=4, int e=5) { return a+b+c+d+e; } assert(args!(fun) == 15); assert(args!(fun, b=>3) == 16); assert(args!(fun, b=>3, d=>3) == 15); static assert(!is(typeof(args!(fun, b=>b)()))); static assert(!is(typeof(args!(fun, x=>42)())));
Mixing named and positional arguments
static int fun(int a, int b=2, int c=3, int d=4, int e=5) { return a+b+c+d+e; } assert(args!(fun)(1) == 15); assert(args!(fun, b=>3)(1) == 16);
Simulates named arguments for function calls. Accepts arguments as lambdas (name => value) on the template parameter list, and positional arguments on the runtime parameter list (see examples below).