Skip to content

strata::Count

Part of Reductions.

struct strata::Count;

How many values of a mask are true, as a std::size_t.

Of bool only: of a mask, not of anything that converts to one. Of no values it is 0.

Members

accumulator

template <std::same_as< bool > T>
using strata::Count::accumulator = std::size_t

What the reducer keeps while values come in.

identity

template <std::same_as<bool> T>
constexpr std::size_t identity() const

Zero: the result of no values.

accumulate

constexpr std::size_t accumulate(std::size_t acc, std::same_as<bool> auto value) const

acc plus one if the value is true.

combine

constexpr std::size_t combine(std::size_t lhs, std::size_t rhs) const

The sum of two partial counts.

finalize

constexpr std::size_t finalize(std::size_t acc, std::size_t) const

The accumulator itself, whatever the count.