Select

Aliases itself to T[0] if cond is $(D_KEYWORD true), to T[1] if $(D_KEYWORD false).

template Select (
bool cond
T...
) if (
T.length == 2
) {}

Members

Aliases

Select
alias Select = T[0]
Undocumented in source.
Select
alias Select = T[1]
Undocumented in source.

Parameters

cond

Template predicate.

T

Two arguments.

Return Value

T[0] if cond is $(D_KEYWORD true), T[1] otherwise.

Examples

static assert(is(Select!(true, int, float) == int));
static assert(is(Select!(false, int, float) == float));

Meta