Like trFilter, but evaluates pred at compile-time with each element's type.
Sink, calls predicate over each value in r. If predicate returns a boolean, use that to determine whether to stop or keep going.
Passes only values satisfying the given predicate to the next layer.
Calls predicate with only the first value in r.
Convert a regular (homogeneous) range to a tuple range.
r is a tuple range of tuple ranges. Process it as one big range.
Transforms values using the given predicate before passing them to the next layer.
Source, iterates over the given values.
int a = 2; int offset = 1; int x; trOnly(0, 1., 2f) .trMap!(n => n + offset) .trFilter!(n => n > a) .trEach!((n) { x = cast(int)n; } ); assert(x == 3);
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
Tuple ranges
Contains constructs for iterating and chaining together operations on range-like constructs which operate on heterogeneous types.
To allow heterogeneous elements, iteration is internal rather than external. The range elements are functors - calling a range with a function parameter "next" asks the range to iterate over its members and call "next" over each one. "next" returns a bool (true if iteration should stop, false if it should continue), which is propagated by the range's opCall upwards.