Skip to content

multi_cartesian_product of zero iterators should produce one empty Vec #337

@andersk

Description

@andersk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions