June 2018
Intermediate to advanced
348 pages
8h 45m
English
We have already learned about function-composition in this book (Chapter 2, A Tour of Modern C++ and Its Key Idioms). Function composition is possible when the return value of a function is type compatible with the input parameter of another function. In the case of operators, since most of them return Observables and take Observables as a parameter, they are compatible for function composition. In this section, our operators are compatible for composition, but they cannot be chained yet. Let's see how we can compose operators:
//----------- operatorCompose.cpp #include "rxcpp/rx.hpp" #include "rxcpp/rx-test.hpp" #include <iostream> namespace rxu=rxcpp::util; #include <array> using namespace rxcpp; using namespace ...