D-Programming-Language/phobos — pull request #659 by jmdavis (2012-07-02 01:14:29+00:00)
Title: Fix for issue# 8334:  find cannot handle close match at end of haystack in needle isn't bi-directiona

This was failing with a RangeError:

auto haystack = [1, 2, 3, 4, 1, 9, 12, 42];
auto needle = filter!"true"([12, 42, 27]);
assert(find(haystack, needle).empty);

This pull request fixes that. It also adds `std.range.emptyRange` as part of it to avoid code duplication in the case where it was necessary to get an empty range from a range which wasn't sliceable.