getparams

Get the parameters of function as a string.

pt_alias refers to an alias of ParameterTypeTuple!fn visible to wherever you want to mix in the results. pd_alias refers to an alias of ParameterDefaultValueTuple!fn visible to wherever you want to mix in the results.

template getparams (
alias fn
string pt_alias
string pd_alias
) {
enum var;
enum getparams;
}

Examples

void foo(int i, int j=2) {
}

static assert(getparams!(foo,"P","Pd") == "P[0] i, P[1] j = Pd[1]");

Meta