The OpenD Programming Language

lessThan

Predicate that returns a < b. Correctly compares signed and unsigned integers, ie. -1 < 2U.

import std.functional;
alias lessThan = safeOp!"<"

Examples

assert(lessThan(2, 3));
assert(lessThan(2U, 3U));
assert(lessThan(2, 3.0));
assert(lessThan(-2, 3U));
assert(lessThan(2, 3U));
assert(!lessThan(3U, -2));
assert(!lessThan(3U, 2));
assert(!lessThan(0, 0));
assert(!lessThan(0U, 0));
assert(!lessThan(0, 0U));

Meta