ReactivePlusPlus
ReactiveX implementation for C++20
|
Aggregate operators are operators that operate on the entire sequence of items emitted by an Observable. More...
Functions | |
template<typename Seed , typename Accumulator > requires (!utils::is_not_template_callable<Accumulator> || std::same_as<std::decay_t<Seed>, std::invoke_result_t<Accumulator, std::decay_t<Seed> &&, rpp::utils::convertible_to_any>>) | |
auto | rpp::operators::reduce (Seed &&seed, Accumulator &&accumulator) |
Apply a function to each item emitted by an Observable, sequentially, and emit the final value. | |
template<typename Accumulator > | |
auto | rpp::operators::reduce (Accumulator &&accumulator) |
Apply a function to each item emitted by an Observable, sequentially, and emit the final value. | |
Aggregate operators are operators that operate on the entire sequence of items emitted by an Observable.
auto rpp::operators::reduce | ( | Accumulator && | accumulator | ) |
Apply a function to each item emitted by an Observable, sequentially, and emit the final value.
There is no initial value for seed, so, first value would be used as seed value and forwarded as is.
accumulator | function which accepts seed value and new value from observable and return new value of seed. Can accept seed by move-reference. |
#include <rpp/operators/reduce.hpp>
auto rpp::operators::reduce | ( | Seed && | seed, |
Accumulator && | accumulator ) |
Apply a function to each item emitted by an Observable, sequentially, and emit the final value.
seed | initial value for seed |
accumulator | function which accepts seed value and new value from observable and return new value of seed. Can accept seed by move-reference. |
#include <rpp/operators/reduce.hpp>