Bug 17047 – std.algorithm.iteration.splitter should propagate bidirectionality

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-12-30T21:10:15Z
Last change time
2018-03-31T19:29:22Z
Assigned to
No Owner
Creator
Seb

Comments

Comment #0 by greeenify — 2016-12-30T21:10:15Z
For splitter with a range as separator, the propagation for bidirectionality (back, popBack) is missing, see e.g.: https://github.com/dlang/phobos/blob/3d98191ce9fee0d2bf2b2c4982242afe413e37bd/std/algorithm/iteration.d#L3839 Moreover, there are no tests either for the bidirectionaility of splitter with a sole element as splitter. It might even be possible to unify both splitter implementations - they look pretty similar.
Comment #1 by greensunny12 — 2018-03-31T19:29:22Z
https://github.com/dlang/phobos/pull/6150 > Making splitter a bidirectional range fundamentally broken - at least if the delimiter has more than one element. Think about something like --- auto result = "*******".splitter("**"); // odd number in the string being split, even number in the delimeter --- > The range is not going to have the same elements if it's iterated from the back. It will end up being split differently.