Merge branch 'master' of https://github.com/torarin/phobos into testing-pull-request

This commit is contained in:
andralex 2011-04-25 00:52:15 -05:00
commit e9c639d1ff

View file

@ -4322,11 +4322,10 @@ bool equal(alias pred = "a == b", Range1, Range2)(Range1 r1, Range2 r2)
if (isInputRange!(Range1) && isInputRange!(Range2)
&& is(typeof(binaryFun!pred(r1.front, r2.front))))
{
foreach (e1; r1)
for (; !r1.empty; r1.popFront(), r2.popFront())
{
if (r2.empty) return false;
if (!binaryFun!(pred)(e1, r2.front)) return false;
r2.popFront;
if (!binaryFun!(pred)(r1.front, r2.front)) return false;
}
return r2.empty;
}
@ -4346,6 +4345,9 @@ unittest
// predicated
double[] c = [ 1.005, 2, 4, 3];
assert(equal!(approxEqual)(b, c));
// utf-8 strings
assert(equal("æøå", "æøå"));
}
// cmp