Skip to Content
C++ Reactive Programming
book

C++ Reactive Programming

by Praseed Pai, Peter Abraham
June 2018
Intermediate to advanced
348 pages
8h 45m
English
Packt Publishing
Content preview from C++ Reactive Programming

Composing custom RxCpp operators

We have already learned about function-composition in this book (Chapter 2A 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Functional Programming in C++

Functional Programming in C++

Ivan Cukic

Publisher Resources

ISBN: 9781788629775Supplemental Content