Skip to content

cartesianProduct should have length for finite ranges #9871

@dlangBugzillaToGithub

Description

@dlangBugzillaToGithub

dlang-bugzilla (@CyberShadow) reported this on 2024-05-07T09:16:37Z

Transfered from https://issues.dlang.org/show_bug.cgi?id=24541

Description

Does not compile:

    import std.algorithm.setops;
    assert(cartesianProduct([1, 2], [3, 4]).length == 4);

Currently the code does:

        return joiner(map!((ElementType!R1 a) => zip(repeat(a), range2.save))
                          (range1));

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions