The OpenD Programming Language

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 std.typecons.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.

  1. auto cumulativeFold(R range)
  2. auto cumulativeFold(R range, S seed)
    template cumulativeFold(fun...)
    cumulativeFold
    (
    R
    S
    )
    (,)
    if (
    fun.length >= 1
    )

Parameters

range R
seed S

the initial value of the accumulator

Return Value

Type: auto

a range containing the consecutive reduced values.

Meta