ReactivePlusPlus
One more implementation of ReactiveX approach in C++ with care about performance and templates in mind
 
Loading...
Searching...
No Matches
publish.hpp
1// ReactivePlusPlus library
2//
3// Copyright Aleksey Loginov 2022 - present.
4// Distributed under the Boost Software License, Version 1.0.
5// (See accompanying file LICENSE_1_0.txt or copy at
6// https://www.boost.org/LICENSE_1_0.txt)
7//
8// Project home: https://github.com/victimsnino/ReactivePlusPlus
9//
10
11#pragma once
12
13#include <rpp/observables/constraints.hpp>
14#include <rpp/operators/multicast.hpp>
15#include <rpp/operators/fwd/publish.hpp>
16
17IMPLEMENTATION_FILE(publish_tag);
18
19namespace rpp::details
20{
21template<constraint::decayed_type Type, constraint::observable_of_type<Type> TObs>
22auto publish_impl(TObs&& observable)
23{
24 return std::forward<TObs>(observable).multicast(rpp::subjects::publish_subject<Type>{});
25}
26} // namespace rpp::details
Subject which just multicasts values to observers subscribed on it. It contains two parts: subscriber...
Definition: publish_subject.hpp:78