June 2018
Intermediate to advanced
348 pages
8h 45m
English
The following program will help us to understand how filter and map Operators work, besides the usual mechanism of connecting an Observer to Observable Streams ,using the subscribe method. The filter method evaluates a predicate on each item of the Stream, and if the evaluation happens to produce a positive assertion, the item will be present in the output Stream. The map operator applies a lambda expression on each element of its input Stream and helps produce an output value every time (which can be propagated through the pipeline):
/////////////////////////////////////// // Second.cpp #include "rxcpp/rx.hpp" #include <ioStream> int main() { auto values = rxcpp::observable<>::range(1, 12). filter([](int ...