More powerful foreach statements

Andrei Khropov andkhropov at nospam_mtu-net.ru
Thu Jul 20 14:09:34 PDT 2006


Ben Phillips wrote:

> In article <e9ogh7$b1b$1 at digitaldaemon.com>, kris says...
> > 
> > 1)  foreach (int i, Foo f; ManyFooInstance)
> >              if (i is 0)
> >                  ....
> > 
> > Or somthing like that.
> > 
> 
> I tested it and it works, AND its documented. My fault.

And you can save you some typing if you like by omitting types:

------------------------------------------------------------------
foreach ( i,foo; ManyFooInstance)
   if (i is 0)
------------------------------------------------------------------

-- 
AKhropov



More information about the Digitalmars-d mailing list