itertools
itertools copied to clipboard
multi_cartesian_product of zero iterators should produce one empty Vec
One would expect
for v in (0..n).map(|_| &[0, 1]).multi_cartesian_product() {
println!("{:?}", v);
}
to enumerate all {0, 1} vectors of length n
. However, it fails when n == 0
, printing no vectors instead of the expected single vector []
.