[Issue 12842] New: More support for ranges of ranges

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jun 2 06:22:02 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12842

          Issue ID: 12842
           Summary: More support for ranges of ranges
           Product: D
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody at puremagic.com
          Reporter: john.loughran.colvin at gmail.com

std.range and std.algorithm often have support for an arbitrary number of
ranges passed as seperate parameters, but very few offer range-of-range
support. 

Usage example:

auto a = [1,2,3,4];
auto b = [5,6,7,8,9];

//a rectangular matrix in flat form
auto cp = cartesianProduct(a, b).map!"a[0] * b[0]"();

//expand to RoR, take the transform and return to flat
auto cpT = cp.chunks(a.length).roundRobin().joiner();


Currently that doesn't work as roundRobin doesn't know how to handle ranges of
ranges.

--


More information about the Digitalmars-d-bugs mailing list