On 2/24/13, Jonathan M Davis <jmdavisp...@gmx.com> wrote: > Those _do_ work. The problem is that you're not trying that; you're trying > ["foo"].equal(["foo"d]);
Ah that makes sense, thanks. A run of the mill implementation takes care of things: bool equal(Range1, Range2)(Range1 r1, Range2 r2) if (isInputRange!Range1 && isInputRange!Range2 && isInputRange!(ElementType!Range1) && isInputRange!(ElementType!Range2)) { if (r1.length != r2.length) return false; foreach (lhs, rhs; zip(r1, r2)) { if (!.equal(lhs, rhs)) return false; } return true; } It's not tested though, but I see what you mean by recursion now. I'll file an enhancement. One thing I don't understand is why the above won't work if I put it in my own module (compile-time error), it has to be put in std.algorithm for all the template overloads to be part of one overload set. Using aliases won't work either, e.g.: import std.algorithm; alias std.algorithm.equal equal; // conflict bool equal(Range1, Range2)(Range1 r1, Range2 r2) if (isInputRange!Range1 && isInputRange!Range2 && isInputRange!(ElementType!Range1) && isInputRange!(ElementType!Range2)) { if (r1.length != r2.length) return false; foreach (lhs, rhs; zip(r1, r2)) { if (!.equal(lhs, rhs)) return false; } return true; } It sounds to me like it's a compiler bug.