• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include "rxcpp/rx.hpp"
2 
3 #include "rxcpp/rx-test.hpp"
4 #include "catch.hpp"
5 
6 SCENARIO("scan sample"){
7     printf("//! [scan sample]\n");
8     auto values = rxcpp::observable<>::range(1, 7).
9         scan(
10             0,
__anon508bd5d40102(int seed, int v)11             [](int seed, int v){
12                 return seed + v;
13             });
14     values.
15         subscribe(
__anon508bd5d40202(int v)16             [](int v){printf("OnNext: %d\n", v);},
__anon508bd5d40302()17             [](){printf("OnCompleted\n");});
18     printf("//! [scan sample]\n");
19 }
20