Function List.opCmp

Compares the contents of a list with another list or range.

int opCmp(R) (
  scope R rhs
) const nothrow scope
if (isBtlInputRange!R && !isList!R);

int opCmp(L) (
  auto scope const ref L rhs
) const nothrow scope
if (isList!L);

Examples

auto a1 = List!(int).build(1, 2, 3);
auto a2 = List!(int).build(1, 2, 3, 4);
auto b = List!(int).build(3, 2, 1);

assert(a1 < b);
assert(a1 < a2);
assert(a2 < b);
assert(a1 <= a1);