Construction from an input and an index.
Random-access primitive. It is offered if isRandomAccessRange!RangeOfRanges && (opt == TransverseOptions.assumeNotJagged || opt == TransverseOptions.enforceNotJagged).
Bidirectional primitives. They are offered if isBidirectionalRange!RangeOfRanges.
Forward range primitives.
Random-access primitive. It is offered if isRandomAccessRange!RangeOfRanges && (opt == TransverseOptions.assumeNotJagged || opt == TransverseOptions.enforceNotJagged).
Slicing if offered if RangeOfRanges supports slicing and all the conditions for supporting indexing are met.
Bidirectional primitives. They are offered if isBidirectionalRange!RangeOfRanges.
Forward range primitives.
Bidirectional primitives. They are offered if isBidirectionalRange!RangeOfRanges.
Forward range primitives.
Forward range primitives.
Controls the assumptions the function makes about the lengths of the ranges
At minimum, an input range. Range primitives such as bidirectionality and random access are given if the element type of rr provides them.
import std.algorithm.comparison : equal; int[][] x = new int[][2]; x[0] = [1, 2]; x[1] = [3, 4]; auto ror = transversal(x, 1); assert(equal(ror, [ 2, 4 ]));
The following code does a full unzip
import std.algorithm.comparison : equal; import std.algorithm.iteration : map; int[][] y = [[1, 2, 3], [4, 5, 6]]; auto z = y.front.walkLength.iota.map!(i => transversal(y, i)); assert(equal!equal(z, [[1, 4], [2, 5], [3, 6]]));
Given a range of ranges, iterate transversally through the nth element of each of the enclosed ranges. This function is similar to unzip in other languages.