isGreaterEqual

Tests whether Args[0] is greater than or equal to Args[1] according to cmp.

cmp 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.
template isGreaterEqual (
alias cmp
Args...
) if (
Args.length == 2 &&
__traits(isTemplate, cmp)
) {}

Members

Variables

isGreaterEqual
enum bool isGreaterEqual;
Undocumented in source.
isGreaterEqual
enum bool isGreaterEqual;
Undocumented in source.

Parameters

Args

Two aliases to compare for equality.

Return Value

$(D_KEYWORD true) if Args[0] is greater than or equal to Args[1], $(D_KEYWORD false) otherwise.

Examples

enum bool boolCmp(T, U) = T.sizeof < U.sizeof;
static assert(!isGreaterEqual!(boolCmp, byte, int));
static assert(isGreaterEqual!(boolCmp, uint, int));
static assert(isGreaterEqual!(boolCmp, long, int));

enum ptrdiff_t intCmp(T, U) = T.sizeof - U.sizeof;
static assert(!isGreaterEqual!(intCmp, byte, int));
static assert(isGreaterEqual!(intCmp, uint, int));
static assert(isGreaterEqual!(intCmp, long, int));

Meta