MCPcopy Create free account
hub / github.com/AlexInLog/ReactivePlusPlus / main

Function main

src/examples/rpp/doxygen/switch_on_next.cpp:8–20  ·  view source on GitHub ↗

* @example switch_on_next.cpp **/

Source from the content-addressed store, hash-verified

6 * @example switch_on_next.cpp
7 **/
8int main()
9{
10 //! [switch_on_next]
11 rpp::source::just(rpp::source::just(1).as_dynamic(),
12 rpp::source::never<int>().as_dynamic(),
13 rpp::source::just(2).as_dynamic())
14 | rpp::operators::switch_on_next()
15 | rpp::operators::subscribe([](int v) { std::cout << v << " "; });
16 // Output: 1 2
17 //! [switch_on_next]
18
19 return 0;
20}

Callers

nothing calls this directly

Calls 4

justFunction · 0.85
switch_on_nextFunction · 0.85
subscribeFunction · 0.85
as_dynamicMethod · 0.45

Tested by

no test coverage detected