Another cool mini-project: advance a range within n steps from its end

Sebastiaan Koppe via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 4 15:09:31 PST 2015


On Friday, 4 December 2015 at 22:53:01 UTC, Andrei Alexandrescu 
wrote:
> Doesn't work. Try it!

void main()
{
	import std.range : retro, take;
	import std.stdio : writeln;
	assert([1,2,3,4,5].retro.take(3).retro == [3,4,5]);
}

What exactly doesn't work?


More information about the Digitalmars-d mailing list