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.hpp File Reference

For each item from this observable, filter out repeated values and emit only items that have not already been emitted. More...

#include "../rx-includes.hpp"
Include dependency graph for rx-distinct.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_tag >
 

Namespaces

 rxcpp
 
 rxcpp::operators
 

Macros

#define RXCPP_OPERATORS_RX_DISTINCT_HPP
 

Functions

template<class... AN>
auto rxcpp::operators::distinct (AN &&...an) -> operator_factory< distinct_tag, AN... >
 For each item from this observable, filter out repeated values and emit only items that have not already been emitted. More...
 

Detailed Description

For each item from this observable, filter out repeated values and emit only items that have not already been emitted.

Returns
Observable that emits those items from the source observable that are distinct.
Note
istinct keeps an unordered_set<T> of past values. Due to an issue in multiple implementations of std::hash<T>, rxcpp maintains a whitelist of hashable types. new types can be added by specializing rxcpp::filtered_hash<T>
Sample Code
auto values = rxcpp::observable<>::from(1, 2, 2, 3, 3, 3, 4, 5, 5).distinct();
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_HPP