RxCpp
The Reactive Extensions for Native (RxCpp) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators in both C and C++.
Classes | Namespaces | Macros | Functions
rx-distinct_until_changed.hpp File Reference

For each item from this observable, filter out consequentially repeated values and emit only changes from the new observable that is returned. More...

#include "../rx-includes.hpp"
Include dependency graph for rx-distinct_until_changed.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  rxcpp::member_overload< distinct_until_changed_tag >
 

Namespaces

 rxcpp
 
 rxcpp::operators
 

Macros

#define RXCPP_OPERATORS_RX_DISTINCT_UNTIL_CHANGED_HPP
 

Functions

template<class... AN>
auto rxcpp::operators::distinct_until_changed (AN &&...an) -> operator_factory< distinct_until_changed_tag, AN... >
 For each item from this observable, filter out consequentially repeated values and emit only changes from the new observable that is returned. More...
 

Detailed Description

For each item from this observable, filter out consequentially repeated values and emit only changes from the new observable that is returned.

Template Parameters
BinaryPredicate(optional) the type of the value comparing function. The signature should be equivalent to the following: bool pred(const T1& a, const T2& b);
Parameters
pred(optional) the function that implements comparison of two values.
Returns
Observable that emits those items from the source observable that are distinct from their immediate predecessors.
Sample Code
auto values = rxcpp::observable<>::from(1, 2, 2, 3, 3, 3, 4, 5, 5).distinct_until_changed();
values.
[](int v){printf("OnNext: %d\n", v);},
[](){printf("OnCompleted\n");});
OnNext: 1
OnNext: 2
OnNext: 3
OnNext: 4
OnNext: 5
OnCompleted

Macro Definition Documentation

#define RXCPP_OPERATORS_RX_DISTINCT_UNTIL_CHANGED_HPP