ReactivePlusPlus
ReactiveX implementation for C++20
Loading...
Searching...
No Matches
rpp::constraint::observable_strategy Concept Reference

A concept that defines the requirements for an observable strategy. More...

#include <fwd.hpp>

Concept definition

template<typename S, typename T>
concept rpp::constraint::observable_strategy = requires(const S& strategy, rpp::details::observers::fake_observer<T>&& observer) {
{
strategy.subscribe(std::move(observer))
} -> std::same_as<void>;
typename S::value_type;
typename S::optimal_disposables_strategy;
}
A concept that defines the requirements for an observable strategy.
Definition fwd.hpp:35
Definition fwd.hpp:250

Detailed Description

A concept that defines the requirements for an observable strategy.

This concept ensures that a type S meets the following criteria:

  • It has a subscribe method that accepts observer of type T and returns void.
  • It defines a nested type value_type to represent the type of values emitted by the observable.
  • It defines a nested type optimal_disposables_strategy to define the optimal disposables strategy observer could/should use to handle current observable properly.
Template Parameters
SThe type to be checked against the concept.
TThe type of the values emitted by the observable.