1 #include "rxcpp/rx.hpp"
2 
3 #include "rxcpp/rx-test.hpp"
4 #include "catch.hpp"
5 
6 SCENARIO("all sample") {
7     printf("//! [all sample]\n");
__anon4b8a2fa10102(int n) 8     auto values = rxcpp::observable<>::from(1, 2, 3, 4, 5).all([](int n) { return n < 6; });
9     values.
10             subscribe(
__anon4b8a2fa10202(bool v) 11             [](bool v) { printf("OnNext: %s\n", v ? "true" : "false"); },
__anon4b8a2fa10302() 12             []() { printf("OnCompleted\n"); });
13     printf("//! [all sample]\n");
14 }
15 
16 SCENARIO("all - operator syntax sample") {
17     using namespace rxcpp;
18     using namespace rxcpp::sources;
19     using namespace rxcpp::operators;
20 
21     printf("//! [all - operator syntax sample]\n");
22     auto values = range(1, 10)
__anon4b8a2fa10402(int n) 23         | all([](int n) { return n < 100; });
24     values.
25             subscribe(
__anon4b8a2fa10502(bool v) 26             [](bool v) { printf("OnNext: %s\n", v ? "true" : "false"); },
__anon4b8a2fa10602() 27             []() { printf("OnCompleted\n"); });
28     printf("//! [all - operator syntax sample]\n");
29 }