| 7 | **/ |
| 8 | |
| 9 | int main() |
| 10 | { |
| 11 | //! [distinct_until_changed] |
| 12 | rpp::source::just(1, 1, 2, 2, 3, 2, 1) |
| 13 | | rpp::operators::distinct_until_changed() |
| 14 | | rpp::operators::subscribe([](int val) { std::cout << val << " "; }); |
| 15 | // Output: 1 2 3 2 1 |
| 16 | //! [distinct_until_changed] |
| 17 | |
| 18 | std::cout << std::endl; |
| 19 | //! [distinct_until_changed_with_comparator] |
| 20 | rpp::source::just(1, 1, 2, 2, 3, 2, 1) |
| 21 | | rpp::operators::distinct_until_changed([](int left, int right) { return left != right; }) |
| 22 | | rpp::operators::subscribe([](int val) { std::cout << val << " "; }); |
| 23 | // Output: 1 1 1 |
| 24 | //! [distinct_until_changed_with_comparator] |
| 25 | return 0; |
| 26 | } |
nothing calls this directly
no test coverage detected