On Tue, 13 Apr 2010 11:15:15 -0400, Joseph Wakeling <[email protected]> wrote:

As for iteration, I don't know to what degree D's foreach() across
arrays compares to for() commands in C++ -- I guess it should be pretty
close in performance, no?

D special cases foreach on arrays to basically be a standard array for loop, i.e.:

foreach(x; arr)
{
   ...
}

translates to something like:

auto __len = arr.length;
for(uint __i = 0; __i < __len; ++__i)
{
   auto x = arr[__i];
   ...
}

Although it may be even further optimized, I'm not sure.

-Steve

Reply via email to