Issue 24541 - cartesianProduct should have length for finite ranges
Summary: cartesianProduct should have length for finite ranges
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-07 09:16 UTC by Vladimir Panteleev
Modified: 2024-12-01 16:42 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Vladimir Panteleev 2024-05-07 09:16:37 UTC
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));
Comment 1 dlangBugzillaToGithub 2024-12-01 16:42:30 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/9871

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB