What is ReactivePlusPlus?
v2ReactivePlusPlus (RPP) is a reactive programming library for C++20 designed for building asynchronous, event-driven data streams. It uses a declarative approach where streams are constructed by composing primitive operators using the pipe (|) operator.
Key characteristics:
- C++20 Native: Built using modern C++20 features, specifically concepts, which provide clearer error messages and better type safety during compilation.
- Zero-Overhead Principle: Designed for high performance, aiming to be faster than RxCpp by minimizing heap usage and unnecessary copies.
- Declarative Syntax: Uses a sequence of operators to transform and manage data flows.
RPP also provides specialized modules for integration with:
- Qt (
rppqt) - gRPC (
rppgrpc) - boost::asio (
rppasio)
rpp::source::from_callable(&::getchar)
| rpp::operators::repeat()
| rpp::operators::take_while([](char v) { return v != '0'; })
| rpp::operators::filter(std::not_fn(&::isdigit))
| rpp::operators::map(&::toupper)
| rpp::operators::subscribe([](char v) { std::cout << v; });