June 2018
Intermediate to advanced
348 pages
8h 45m
English
The data in STL containers are considered as the data which exists in space.(data which are already captured). Even though Rx streams are meant for processing data varying over time (dynamic), we can convert an STL container into a Rx Stream. We need to use Iterate operator to do the conversion. This can be handy at times and has been helpful in integrating code from code bases that use STL:
// STLContainerStream.cpp#include "rxcpp/rx.hpp"#include <ioStream>#include <array>int main() { std::array< int, 3 > a={{1, 2, 3}}; auto values = rxcpp::observable<>::iterate(a); values.subscribe([](int v){printf("OnNext: %dn", v);}, [](){printf("OnCompleted\n");});}
Read now
Unlock full access