templateOr

Combines multiple templates with logical OR. So $(D_PSYMBOL templateOr) evaluates to Preds[0] || Preds[1] || Preds[2] and so on.

Empty Preds evaluates to $(D_KEYWORD false).

template templateOr (
Preds...
) if (
allSatisfy!(isTemplate, Preds)
) {}

Members

Templates

templateOr
template templateOr(T...)
Undocumented in source.

Parameters

Preds

Template predicates.

Return Value

The constructed template.

Examples

alias isMutableOrInt = templateOr!(isIntegral, isMutable);
static assert(isMutableOrInt!int);
static assert(isMutableOrInt!(const int));
static assert(isMutableOrInt!float);
static assert(!isMutableOrInt!(const float));

alias alwaysFalse = templateOr!();
static assert(!alwaysFalse!int);

alias isIntegral = templateOr!(.isIntegral);
static assert(isIntegral!int);
static assert(isIntegral!(const int));
static assert(!isIntegral!float);

Meta