[Issue 24541] New: cartesianProduct should have length for finite ranges
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue May 7 09:16:37 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24541
Issue ID: 24541
Summary: cartesianProduct should have length for finite ranges
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P4
Component: phobos
Assignee: nobody at puremagic.com
Reporter: dlang-bugzilla at thecybershadow.net
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));
--
More information about the Digitalmars-d-bugs
mailing list