std.algorithm.map + std.algorithm.joiner = broken forward range
jerro
a at a.com
Tue Oct 9 20:00:00 PDT 2012
On Wednesday, 10 October 2012 at 02:11:49 UTC, H. S. Teoh wrote:
> Code:
> import std.algorithm;
> import std.range;
> import std.stdio;
>
> void main() {
> auto x = [[1],[2],[3]];
> auto yy = x.map!"a".joiner;
>
> assert(isForwardRange!(typeof(yy)));
> writeln(yy.save);
> writeln(yy);
> }
>
> Output:
>
> []
> [1, 2, 3]
>
> :-(
>
> That is to say, yy.save didn't save the range at all!
>
>
> T
It happens without map too.
More information about the Digitalmars-d
mailing list