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

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 4 17:03:05 PST 2015


On 12/04/2015 06:09 PM, Sebastiaan Koppe wrote:
> 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?

Forward ranges.


More information about the Digitalmars-d mailing list