ulib/3party/rxcpp/Rx/v2/examples/doxygen/distinct_until_changed.cpp

16 lines
452 B
C++
Raw Normal View History

2024-01-10 09:33:36 +08:00
#include "rxcpp/rx.hpp"
#include "rxcpp/rx-test.hpp"
#include "catch.hpp"
SCENARIO("distinct_until_changed sample"){
printf("//! [distinct_until_changed sample]\n");
auto values = rxcpp::observable<>::from(1, 2, 2, 3, 3, 3, 4, 5, 5).distinct_until_changed();
values.
subscribe(
[](int v){printf("OnNext: %d\n", v);},
[](){printf("OnCompleted\n");});
printf("//! [distinct_until_changed sample]\n");
}