[Issue 10933] findSplitBefore/After should have needle-less overloads

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 21 18:25:16 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=10933

--- Comment #1 from Luís Marques <luis at luismarques.eu> ---
Yup, I've ran into the same issue multiple times. This last time with the plain
findSplit; I don't recall if also with findSplitBefore/After.

This workaround works:

range.byCodeUnit.findSplit!((a, b) => a.isWhite)(" ");

Interestingly, if you use "" instead of " " it won't work, which arguably is a
bug, since the predicate doesn't even use b.

--


More information about the Digitalmars-d-bugs mailing list