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