ParameterTuple

Returns a Tuple of the parameters. It can be used to declare function.

Members

Aliases

ParameterTuple
alias ParameterTuple = Params
Undocumented in source.

Examples

void foo(string val = "Test", int = 10);
void bar(ParameterTuple!foo) { assert(val == "Test"); }
// Variadic functions require special handling:
import core.vararg;
void foo2(string val, ...);
void bar2(ParameterTuple!foo2, ...) { assert(val == "42"); }

bar();
bar2("42");

// Note: outside of a parameter list, it's value is the type of the param.
import std.traits : ParameterDefaultValueTuple;
ParameterTuple!(foo)[0] test = ParameterDefaultValueTuple!(foo)[0];
assert(test == "Test");

Meta