I just discovered that zip has StoppingPolicy so why does

auto commonPrefixLength(R...)(R ranges) if (ranges.length == 2)
{
    import std.range: zip;
    return zip!((a, b) => a[0] != b[1])(ranges);
}

unittest
{
    assert(commonPrefixLength([1, 2, 3, 10],
                              [1, 2, 4, 10]) == 2);
}


StoppingPolicy is not a template parameter, it is this one: http://dlang.org/phobos/std_range.html#.StoppingPolicy

Reply via email to