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