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

Function main

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

* @example merge.cpp **/

Source from the content-addressed store, hash-verified

6 * @example merge.cpp
7 **/
8int main()
9{
10 //! [merge]
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::merge()
15 | rpp::operators::subscribe([](int v) { std::cout << v << " "; });
16 // Output: 1 2
17 //! [merge]
18
19 //! [merge_with]
20 rpp::source::just(1)
21 | rpp::operators::merge_with(rpp::source::just(2))
22 | rpp::operators::subscribe([](int v) { std::cout << v << " "; });
23 // Output: 1 2
24 //! [merge_with]
25 return 0;
26}

Callers

nothing calls this directly

Calls 5

justFunction · 0.85
mergeFunction · 0.85
subscribeFunction · 0.85
merge_withFunction · 0.85
as_dynamicMethod · 0.45

Tested by

no test coverage detected