| 8 | **/ |
| 9 | |
| 10 | int 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 | } |