The predicate.
Ranges and arrays
import std.range : iota; auto r = iota(6); assert(r.equal([0, 1, 2, 3, 4, 5]));
import mir.ndslice.allocation : slice; import mir.ndslice.topology : iota; // 0 1 2 // 3 4 5 auto sl1 = iota(2, 3); // 1 2 3 // 4 5 6 auto sl2 = iota([2, 3], 1); assert(equal(sl1, sl1)); assert(sl1 == sl1); //can also use opEquals for two Slices assert(equal!"2 * a == b + c"(sl1, sl1, sl1)); assert(equal!"a < b"(sl1, sl2)); assert(!equal(sl1[0 .. $ - 1], sl1)); assert(!equal(sl1[0 .. $, 0 .. $ - 1], sl1));
$(NDSLICEREF slice, Slice.opEquals)
Compares two or more slices for equality, as defined by predicate pred.