Skip to content

strata::Product

Part of Reductions.

struct strata::Product;

The product, in the type T * T gives, which must be T's own.

A product of lengths is no length, so it is not accepted. The product of no values is one.

Members

accumulator

template <typename T>
using strata::Product::accumulator = detail::product_t<T>

What the product keeps while values come in.

identity

template <typename T>
constexpr accumulator<T> identity() const

The product of no values: one.

accumulate

template <typename A, typename T>
constexpr A accumulate(A acc, const T &value) const

acc times one value.

combine

template <typename A>
constexpr A combine(A lhs, A rhs) const

The product of two partial products.

finalize

template <typename A>
constexpr A finalize(A acc, std::size_t) const

The accumulator itself, whatever the count.