View source code
Display the source code in std/range/package.d from which this
page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a
Bugzilla issue.
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.
std.range.FrontTransversal/frontTransversal
- multiple declarations
Function frontTransversal
Given a range of ranges, iterate transversally through the first elements of each of the enclosed ranges.
FrontTransversal!(RangeOfRanges,opt) frontTransversal(TransverseOptions opt = TransverseOptions .assumeJagged, RangeOfRanges)
(
RangeOfRanges rr
);
Example
import std .algorithm .comparison : 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
(input)
|
Construction from an input. |
Properties
Name | Type | Description |
---|---|---|
back [get]
|
auto | Bidirectional primitives. They are offered if isBidirectionalRange!RangeOfRanges .
|
front [get]
|
auto | Forward range primitives. |
save [get]
|
FrontTransversal | Duplicates this frontTransversal . Note that only the encapsulating
range of range will be duplicated. Underlying ranges will not be
duplicated.
|
Methods
Name | Description |
---|---|
moveAt
(n)
|
Random-access primitive. It is offered if isRandomAccessRange!RangeOfRanges && (opt ==
TransverseOptions .
|
moveBack
()
|
Bidirectional primitives. They are offered if isBidirectionalRange!RangeOfRanges .
|
moveFront
()
|
Forward range primitives. |
opIndex
(n)
|
Random-access primitive. It is offered if isRandomAccessRange!RangeOfRanges && (opt ==
TransverseOptions .
|
opIndexAssign
(val, n)
|
Random-access primitive. It is offered if isRandomAccessRange!RangeOfRanges && (opt ==
TransverseOptions .
|
opSlice
(lower, upper)
|
Slicing if offered if RangeOfRanges supports slicing and all the
conditions for supporting indexing are met.
|
popBack
()
|
Bidirectional primitives. They are offered if isBidirectionalRange!RangeOfRanges .
|
popFront
()
|
Forward range primitives. |
Example
import std .algorithm .comparison : 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, Jonathan M Davis, and Jack Stouffer. Credit for some of the ideas in building this module goes to Leonardo Maffi.
License
Copyright © 1999-2024 by the D Language Foundation | Page generated by ddox.