Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi_cartesian_product of zero iterators should produce one empty Vec #337

Closed
andersk opened this issue Mar 9, 2019 · 1 comment · Fixed by #835
Closed

multi_cartesian_product of zero iterators should produce one empty Vec #337

andersk opened this issue Mar 9, 2019 · 1 comment · Fixed by #835

Comments

@andersk
Copy link
Contributor

andersk commented Mar 9, 2019

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

@Philippe-Cholet
Copy link
Member

Hi, thanks for bringing this issue to our attention.
I just wanted to say that it has finally been solved and the fix will be released in our next release 0.13.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants