equal

Array-specialization of findLastSplitAfter with default predicate.

  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)
    )
  3. bool startsWith(T[] haystack, T[] needle)
  4. bool startsWith(T[] haystack, T needle)

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

See Also

Meta