D-Programming-Language/phobos — pull request #720 by jmdavis (2012-07-25 07:33:50+00:00)
Title: Fix for issue# 8334: find cannot handle close match at end of haystack in needle isn't bi-directional

Okay. Here's another shot at fixing 8334 (well, another shot at `takeNone`/`emptyRange` anyway - the fix for 8334 is the same). It replaces pull #659. And I think that this approach is ultimately better. The original `takeNone` is still there, but it now has an overload which takes a range and attempts to return a range of the same type as the original (unlike `emptyRange` which guaranteed it but didn't work with ranges where it couldn't guarantee it). So, we mostly get the functionality of both the original `takeNone` and `emptyRange`. There are a couple of compiler bugs affecting the implementation, but there's nothing that can be done about that right now, and it shouldn't prevent it from being useful now. It's just that we should be able to get more types returning the same type with `takeNone` once the bugs have been fixed.