equal

ditto

  1. bool equal(T a, U b)
  2. bool equal(const(T)[] a, const(U)[] b)
    bool
    equal
    (
    T
    U
    )
    (
    scope const(T)[] a
    ,
    scope const(U)[] b
    )
    if (
    is(typeof(T.init == U.init) : bool)
    )

Examples

dynamic arrays

assert(!equal([1, 2   ].s[], [1, 2, 3].s[]));
assert(!equal([1, 2, 3].s[], [1, 2,  ].s[]));
assert( equal([1, 2, 3].s[], [1, 2, 3].s[]));

static arrays

assert(!equal([1, 2   ].s, [1, 2, 3].s));
assert(!equal([1, 2, 3].s, [1, 2,  ].s));
assert( equal([1, 2, 3].s, [1, 2, 3].s));

Meta