itertools icon indicating copy to clipboard operation
itertools copied to clipboard

multi_cartesian_product of zero iterators should produce one empty Vec

Open andersk opened this issue 5 years ago • 0 comments

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 [].

andersk avatar Mar 09 '19 20:03 andersk