ParameterDefaults

Get, as a tuple, the default values of the parameters to a function symbol. If a parameter doesn't have the default value, void is returned instead.

template ParameterDefaults (
alias func
) if (
isCallable!func
) {}

Examples

int foo(int num, string name = "hello", int[] = [1,2,3], lazy int x = 0);
static assert(is(ParameterDefaults!foo[0] == void));
static assert(   ParameterDefaults!foo[1] == "hello");
static assert(   ParameterDefaults!foo[2] == [1,2,3]);
static assert(   ParameterDefaults!foo[3] == 0);

Meta