ReduceTuple

The instantiation of ReduceTuple!(Func, init, A) first lets result be init. Then, for each element x in A sequentially, it lets result be Inst!(BinaryTemplate!Func, result, x). Finally, result is returned.

  1. template ReduceTuple(alias Func, alias init, A...)
  2. template ReduceTuple(alias Func, Init, A...)

Members

Aliases

Init
alias Init = init
Undocumented in source.
ReduceTuple
alias ReduceTuple = Res
Undocumented in source.

Mixins

__anonymous
mixin ReduceTupleImpl
Undocumented in source.

Mixed In Members

From mixin ReduceTupleImpl

FuncTemplate
alias FuncTemplate = BinaryTemplate!Func
Undocumented in source.
Res
alias Res = .ReduceTuple!(FuncTemplate, FuncTemplate!(Init, A[0]), A[1..$])
Undocumented in source.
Res
alias Res = Init
Undocumented in source.

Examples

static assert(ReduceTuple!(`a + U.sizeof`, 0, bool, short, int) == 1 + 2 + 4);
static assert(is(ReduceTuple!(`Select!(T.sizeof > U.sizeof, T, U)`, void, bool, long, int) == long));

Analog of $(STDREF algorithm, reduce) for generic tuples except there is no overload with multiple functions.

Meta