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

Function main

src/examples/rpp/doxygen/just.cpp:10–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8 **/
9
10int main() // NOLINT(bugprone-exception-escape)
11{
12 //! [just]
13 rpp::source::just(42, 53, 10, 1).subscribe([](int v) { std::cout << v << std::endl; });
14 // Output: 42 53 10 1
15 //! [just]
16
17 //! [just memory model]
18 std::array<int, 100> expensive_to_copy_1{};
19 std::array<int, 100> expensive_to_copy_2{};
20 rpp::source::just<rpp::memory_model::use_shared>(expensive_to_copy_1, expensive_to_copy_2).subscribe([](const auto&) {});
21 //! [just memory model]
22
23 // //! [just scheduler]
24 rpp::source::just(rpp::schedulers::immediate{}, 42, 53).subscribe([](const auto&) {});
25 rpp::source::just(rpp::schedulers::current_thread{}, 42, 53).subscribe([](const auto&) {});
26 // //! [just scheduler]
27}

Callers

nothing calls this directly

Calls 2

justFunction · 0.85
subscribeMethod · 0.45

Tested by

no test coverage detected