foreach_reverse error

H. S. Teoh hsteoh at quickfur.ath.cx
Wed May 9 15:11:26 PDT 2012


On Wed, May 09, 2012 at 11:09:15PM +0200, Timon Gehr wrote:
> 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)))

Yet another reason foreach_reverse needs to go.


T

-- 
It only takes one twig to burn down a forest.


More information about the Digitalmars-d-learn mailing list