BigInt foreach loop

Q. Schroll via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Aug 4 05:49:30 PDT 2017


One can do
   BigInt n = returnsBigInt();
   foreach (i; BigInt(0) .. n)
   { .. }
How is this implemented? The code for BigInt is very large and I 
didn't find it.
And is it more efficient than
   for (BigInt i = 0; i < n; ++i)
   { .. }
as incrementing is a costly operation?


More information about the Digitalmars-d-learn mailing list