accumulate overloads
Declared in <folly/coro/Accumulate.h>
Accumulate the values from an input stream into a single value, similar to std::accumulate.
template<
typename Reference,
typename Value,
typename Output>
Task<Output>
accumulate(
AsyncGenerator<Reference, Value> generator,
Output init);
» more...
Accumulate the values from an input stream using a binary operation.
template<
typename Reference,
typename Value,
typename Output,
typename BinaryOp>
Task<Output>
accumulate(
AsyncGenerator<Reference, Value> generator,
Output init,
BinaryOp op);
» more...
A Task containing the result of the accumulation.
| Name | Description |
|---|---|
| generator | The input stream of values. |
| init | The initial value of the accumulation. |
| op | The binary operation combining the accumulator and each value. |