std.algorithm.splitter on a string not always bidirectional

Steven Schveighoffer schveiguy at gmail.com
Thu Jan 21 22:43:37 UTC 2021


auto sp1 = "a|b|c".splitter('|');

writeln(sp1.back); // ok

auto sp2 = "a.b|c".splitter!(v => !isAlphaNum(v));

writeln(sp2.back); // error, not bidirectional

Why? is it an oversight, or is there a good reason for it?

-Steve


More information about the Digitalmars-d-learn mailing list