Min

Finds the minimum value in Args according to pred.

Args should contain at least one element.

pred can evaluate to:

  • $(D_KEYWORD bool): $(D_KEYWORD true) means Args[0] < Args[1].
  • $(D_KEYWORD int): a negative number means that Args[0] < Args[1], a positive number that Args[0] > Args[1], 0 if they equal.

Members

Aliases

Min
alias Min = Alias!(Args[0])
Undocumented in source.
Min
alias Min = Min!(pred, Args[1], Args[2..$])
Undocumented in source.
Min
alias Min = Min!(pred, Args[0], Args[2..$])
Undocumented in source.

Parameters

pred

Template predicate.

Args

Elements for which you want to find the minimum value.

Return Value

The minimum.

Examples

enum bool cmp(alias T, alias U) = T < U;
static assert(Min!(cmp, 8, 4, 5, 3, 13) == 3);
static assert(Min!(cmp, 8) == 8);

See Also

$(D_PSYMBOL isLess).

Meta