Using foreach is probably the most idiomatic approach in D. It can be iterated both by index and by value or value.
import std.stdio; void main () { auto arr3 = [ [[1 ,2 ,3 ]], [[4 ,5 ,6 ]], [[7 , 8, 9]], [[11,12,13]], [[14,15,16]], [[17,18,19]] ]; foreach (index3, arr2; arr3) foreach (index2, arr1; arr2) foreach (index1, val ; arr1) { assert (val == arr3[index3][index2][index1]); writeln (val); } }
Michal minich
source share