Vector.opEquals

Compares the contents of a vector with another vector, range or null.

Returns true if they are equal, false otherwise

  1. bool opEquals(typeof(null) nil)
  2. bool opEquals(R rhs)
    struct Vector
    const scope nothrow
    bool
    opEquals
    (
    R
    )
    (
    scope R rhs
    )
  3. bool opEquals(V rhs)

Examples

Vector!(int, 6) vec = Vector!(int, 6).build(1, 2, 3);

assert(vec != null);
assert(null != vec);

assert(vec == [1, 2, 3]);
assert([1, 2, 3] == vec);

assert(vec == typeof(vec).build(1, 2, 3));
assert(typeof(vec).build(1, 2, 3) == vec);


import std.range : only;
assert(vec == only(1, 2, 3));
assert(only(1, 2, 3) == vec);

Meta