View source code
Display the source code in std/range.d from which this page was generated on
github.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
Page wiki
View or edit the community-maintained wiki page associated with this page.
std.range.front_transversal
- multiple declarations
- Function frontTransversal
- Struct FrontTransversal
Function frontTransversal
Given a range of ranges, iterate transversally through the first elements of each of the enclosed ranges.
Prototype
FrontTransversal!(RangeOfRanges,opt) frontTransversal(std.range.TransverseOptions opt, RangeOfRanges)( RangeOfRanges rr );
Example
import std.algorithm : equal; int[][] x = new int[][2]; x[0] = [1, 2]; x[1] = [3, 4]; auto ror = frontTransversal(x); assert(equal(ror, [ 1, 3 ][]));
Struct FrontTransversal
Given a range of ranges, iterate transversally through the first elements of each of the enclosed ranges.
Constructors
Name | Description |
---|---|
this
|
Construction from an input .
|
Properties
Name | Type | Description |
---|---|---|
front
[get]
|
ref |
Construction from an input. |
Methods
Name | Description |
---|---|
popFront
|
Construction from an input. |
Example
import std.algorithm : equal; int[][] x = new int[][2]; x[0] = [1, 2]; x[1] = [3, 4]; auto ror = frontTransversal(x); assert(equal(ror, [ 1, 3 ][]));
Authors
Andrei Alexandrescu, David Simcha, and Jonathan M Davis. Credit for some of the ideas in building this module goes to Leonardo Maffi.