1 #include "rxcpp/rx.hpp" 2 3 #include "rxcpp/rx-test.hpp" 4 #include "catch.hpp" 5 6 SCENARIO("default_if_empty sample"){ 7 printf("//! [default_if_empty sample]\n"); 8 9 auto values = rxcpp::observable<>::empty<int>() 10 .default_if_empty(42); 11 12 values.subscribe( __anonb3e734500102(int v) 13 [](int v) { printf("OnNext: %d\n", v); }, __anonb3e734500202() 14 []() { printf("OnCompleted\n"); } ); 15 16 printf("//! [default_if_empty sample]\n"); 17 } 18