ReactivePlusPlus
ReactiveX implementation for C++20
Loading...
Searching...
No Matches
empty.hpp
1
// ReactivePlusPlus library
2
//
3
// Copyright Aleksey Loginov 2023 - 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
#pragma once
11
12
#include <rpp/sources/fwd.hpp>
13
14
#include <rpp/observables/observable.hpp>
15
16
namespace
rpp::details
17
{
18
template
<constra
int
::decayed_type Type>
19
20
struct
empty_strategy
21
{
22
using
value_type = Type;
23
using
optimal_disposables_strategy
=
rpp::details::observables::fixed_disposables_strategy<0>
;
24
25
static
void
subscribe(
const
auto
& obs) { obs.on_completed(); }
26
};
27
}
// namespace rpp::details
28
29
namespace
rpp
30
{
31
template
<constra
int
::decayed_type Type>
32
using
empty_observable
=
observable<Type, details::empty_strategy<Type>
>;
33
}
// namespace rpp
34
35
namespace
rpp::source
36
{
50
template
<constra
int
::decayed_type Type>
51
auto
empty
()
52
{
53
return
empty_observable<Type>{};
54
}
55
}
// namespace rpp::source
rpp::observable
Base class for any observable used in RPP. It handles core callbacks of observable.
Definition
observable.hpp:38
rpp::source::empty
auto empty()
Creates rpp::observable that emits no items but terminates normally.
Definition
empty.hpp:48
rpp::details::empty_strategy
Definition
empty.hpp:21
rpp::details::observables::fixed_disposables_strategy
Definition
disposables_strategy.hpp:29
src
rpp
rpp
sources
empty.hpp
Generated by
1.12.0