ddash.algorithm.zip

Zips up ranges up together

Members

Functions

zipEach
auto zipEach(RoR rangeOfRanges)

Zip a range of ranges together by element.

Examples

1 auto r1 = [[1, 2, 3], [4, 5, 6]];
2 assert(r1.zipEach.equal([[1, 4], [2, 5], [3, 6]]));
3 auto r2 = [[1, 3], [4, 5, 6]];
4 assert(r2.zipEach.equal([[1, 4], [3, 5]]));
5 auto r3 = [[1, 3], [], [4, 5, 6]];
6 assert(r3.zipEach.equal((int[][]).init));

Meta