Bug 8792 – std.algorithm.joiner doesn't return a proper forward range
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2012-10-09T20:25:00Z
Last change time
2012-10-14T08:28:15Z
Keywords
pull
Assigned to
nobody
Creator
hsteoh
Comments
Comment #0 by hsteoh — 2012-10-09T20:25:31Z
import std.algorithm;
import std.range;
import std.stdio;
void main() {
auto x = [[1],[2],[3]];
auto yy = x.joiner;
assert(isForwardRange!(typeof(yy)));
writeln(yy.save);
writeln(yy);
}
The output is:
[]
[1, 2, 3]
Which means that yy.save didn't save at all! This is a pretty major bug since it makes joiner unusable where the result needs to be a forward range.