access foreach index counter for Iterate n times

Adam D Ruppe destructionator at gmail.com
Sat May 21 16:11:50 UTC 2022


On Saturday, 21 May 2022 at 15:43:59 UTC, mw wrote:
> Same question:
> Why 3 bytes? Not 4 bytes?

Same answer: it is pointing at the character in the ORIGINAL 
ARRAY. The original array is NOT made out of dchars but it reads 
and converts on the fly while maintaining the correct position.

See that's the beauty of it: how it gets there can be pretty 
complicated (especially when going backwards with 
foreach_reverse), but it always gives the right answer.



More information about the Digitalmars-d mailing list