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

Function main

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

* @example buffer.cpp **/

Source from the content-addressed store, hash-verified

23 * @example buffer.cpp
24 **/
25int main()
26{
27 //! [buffer]
28 // The stream that uses rvalue overloads for operators
29 rpp::source::just(1, 2, 3, 4, 5)
30 | rpp::ops::buffer(2)
31 | rpp::ops::subscribe(
32 [](const std::vector<int>& v) { std::cout << v << "-"; },
33 [](const std::exception_ptr&) {},
34 []() { std::cout << "|" << std::endl; });
35 // Source: -1-2-3-4-5--|
36 // Output: {1,2}-{3,4}-{5}-|
37 //! [buffer]
38 return 0;
39}

Callers

nothing calls this directly

Calls 3

justFunction · 0.85
bufferFunction · 0.85
subscribeFunction · 0.85

Tested by

no test coverage detected