std.algorithm.iteration.cumulativeFold.cumulativeFold
- multiple declarations
Function cumulativeFold.cumulativeFold
No-seed version. The first element of r
is used as the seed's value.
For each function f
in fun
, the corresponding seed type S
is
Unqual!(typeof(f(e, e)))
, where e
is an element of r
:
ElementType!R
.
Once S
has been determined, then S s = e;
and s = f(s, e);
must
both be legal.
auto auto cumulativeFold(R)
(
R range
)
if (isInputRange!(Unqual!R));
Parameters
Name | Description |
---|---|
range | An input range |
Returns
a range containing the consecutive reduced values.
Function cumulativeFold.cumulativeFold
Seed version. The seed should be a single value if fun
is a single
function. If fun
is multiple functions, then seed
should be a
Tuple
, with one field per function in f
.
For convenience, if the seed is const
, or has qualified fields, then
cumulativeFold
will operate on an unqualified copy. If this happens
then the returned type will not perfectly match S
.
auto auto cumulativeFold(R, S)
(
R range,
S seed
)
if (isInputRange!(Unqual!R));
Parameters
Name | Description |
---|---|
range | An input range |
seed | the initial value of the accumulator |
Returns
a range containing the consecutive reduced values.