Contents

struct

SushiRuntime::Sum

template <typename T>

Adds two values; identity is the value-initialised T.

Declared in
include/SushiRuntime/api/vocabulary/combine.hpp

Template parameters

T

Element type being reduced.

Public member functions

T operator()(const T &a, const T &b) const

Combines two values by addition.

Parameters

a

Left operand — the accumulator in a fold.

b

Right operand — the next element.

Returns

Their sum.

Static public member functions

static constexpr T identity()

The value a sum of no elements produces.

Returns

The value-initialised T (zero for arithmetic types).