On Sunday, 26 January 2014 at 13:45:32 UTC, matovitch wrote: > Anyway, the proposed solutions use twice much memory than a > simple for loop... ??? > is the compiler smart enougth to optimize this kind of code ? There are ongoing discussions on what and how current D compilers optimize nowadays. I don't have a link though.