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

Function main

src/examples/rpp/doxygen/map.cpp:9–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7 **/
8
9int main() // NOLINT(bugprone-exception-escape)
10{
11 //! [Same type]
12 rpp::source::just(42)
13 | rpp::operators::map([](int value) { return value + 10; })
14 | rpp::operators::subscribe([](int v) { std::cout << v << std::endl; });
15 // Output: 52
16 //! [Same type]
17
18 //! [Changed type]
19 rpp::source::just(42)
20 | rpp::operators::map([](int value) { return std::to_string(value) + " VAL"; })
21 | rpp::operators::subscribe([](const std::string& v) { std::cout << v << std::endl; });
22 // Output: 42 VAL
23 //! [Changed type]
24 return 0;
25}

Callers

nothing calls this directly

Calls 3

justFunction · 0.85
mapFunction · 0.85
subscribeFunction · 0.85

Tested by

no test coverage detected