foreach_reverse error

Timon Gehr timon.gehr at gmx.ch
Wed May 9 14:09:15 PDT 2012


On 05/09/2012 10:50 PM, ixid wrote:
> With this code foreach works but foreach_reverse does not:
>
> void main()
> { int[] ints = [2,2,2,5,5,5,4,4,4];
>   auto temp = group(ints);
>   foreach_reverse(i;temp)
>   i[1].writeln;
> }
>
> Is this a known issue? Is there a sensible reason for this?

group returns a lazy forward range. use foreach(i; group(retro(ints)))


More information about the Digitalmars-d-learn mailing list