For each item from this observable use Accumulator to combine items into a value that will be emitted from the new observable that is returned.
More...
Go to the source code of this file.
|
| template<class... AN> |
| auto | rxcpp::operators::scan (AN &&...an) -> operator_factory< scan_tag, AN... > |
| | For each item from this observable use Accumulator to combine items into a value that will be emitted from the new observable that is returned. More...
|
| |
For each item from this observable use Accumulator to combine items into a value that will be emitted from the new observable that is returned.
- Template Parameters
-
| Seed | the type of the initial value for the accumulator. |
| Accumulator | the type of the data accumulating function. |
- Parameters
-
| seed | the initial value for the accumulator. |
| a | an accumulator function to be invoked on each item emitted by the source observable, whose result will be emitted and used in the next accumulator call. |
- Returns
- An observable that emits the results of each call to the accumulator function.
- Sample Code
0,
[](int seed, int v){
return seed + v;
});
values.
[](int v){printf("OnNext: %d\n", v);},
[](){printf("OnCompleted\n");});
OnNext: 1
OnNext: 3
OnNext: 6
OnNext: 10
OnNext: 15
OnNext: 21
OnNext: 28
OnCompleted
| #define RXCPP_OPERATORS_RX_SCAN_HPP |