Macro itertools::iproduct [−][src]
Create an iterator over the “cartesian product” of iterators.
Iterator element type is like (A, B, ..., E)
if formed
from iterators (I, J, ..., M)
with element types I::Item = A
, J::Item = B
, etc.
// Iterate over the coordinates of a 4 x 4 x 4 grid // from (0, 0, 0), (0, 0, 1), .., (0, 1, 0), (0, 1, 1), .. etc until (3, 3, 3) for (i, j, k) in iproduct!(0..4, 0..4, 0..4) { // .. }