ReactivePlusPlus
ReactiveX implementation for C++20
Loading...
Searching...
No Matches
take_last.cpp
#include <rpp/rpp.hpp>
#include <iostream>
int main()
{
rpp::source::just(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
| rpp::ops::subscribe([](int v) { std::cout << v << " "; });
// Output: 8 9
return 0;
}
auto just(const TScheduler &scheduler, T &&item, Ts &&... items)
Creates rpp::observable that emits a particular items and completes.
Definition from.hpp:201
auto take_last(size_t count)
Emit only last count items provided by observable, then send on_completed
Definition take_last.hpp:119
auto subscribe(observer< Type, ObserverStrategy > &&observer)
Subscribes passed observer to emissions from this observable.
Definition subscribe.hpp:226