More on vectorized comparisons

Peter Alexander peter.alexander.au at gmail.com
Mon Aug 27 13:17:05 PDT 2012


On Friday, 24 August 2012 at 13:57:42 UTC, bearophile wrote:
> That code means:
>
> foreach (i; 0 .. a.length) {
>      if (a[i] > 0) {
>          // ...
>      }
> }

How could this possibly be useful? It's like the loop, but you 
lose the index variable. I can't see how you could possibly do 
anything with this.

Can you show an example of some code that uses this?




More information about the Digitalmars-d mailing list