List.opCmp

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

  1. int opCmp(R rhs)
    struct List
    const scope nothrow
    int
    opCmp
    (
    R
    )
    (
    scope R rhs
    )
  2. int opCmp(L rhs)

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);

Meta