std.algorithm.map + std.algorithm.joiner = broken forward range

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Oct 9 18:49:45 PDT 2012


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
-- 
"The number you have dialed is imaginary. Please rotate your phone 90
degrees and try again."


More information about the Digitalmars-d mailing list