13#include <rpp/disposables/fwd.hpp>
15#include <rpp/disposables/details/container.hpp>
19namespace rpp::details::observers
21 enum class disposables_mode : uint8_t
40 } -> std::same_as<bool>;
45 template<
typename DisposableContainer>
65 template<
size_t Count>
68 using default_disposables_strategy = dynamic_disposables_strategy;
72 template<disposables_mode mode>
73 consteval auto* deduce_optimal_disposables_strategy()
75 static_assert(mode == disposables_mode::Auto || mode == disposables_mode::None || mode == disposables_mode::External || mode == disposables_mode::Boolean);
77#if defined(RPP_DISABLE_DISPOSABLES_OPTIMIZATION) and RPP_DISABLE_DISPOSABLES_OPTIMIZATION
78 if constexpr (mode == disposables_mode::External)
81 return static_cast<default_disposables_strategy*
>(
nullptr);
83 if constexpr (mode == disposables_mode::Auto)
84 return static_cast<default_disposables_strategy*
>(
nullptr);
85 else if constexpr (mode == disposables_mode::None)
87 else if constexpr (mode == disposables_mode::External)
89 else if constexpr (mode == disposables_mode::Boolean)
92 return static_cast<void*
>(
nullptr);
97 template<rpp::details::observers::disposables_mode Mode>
98 using deduce_optimal_disposables_strategy_t = std::remove_pointer_t<decltype(details::deduce_optimal_disposables_strategy<Mode>())>;
Definition disposables_strategy.hpp:60
Definition disposables_strategy.hpp:24
disposable_wrapper_impl< interface_composite_disposable > composite_disposable_wrapper
Wrapper to keep "composite" disposable. Specialization of rpp::disposable_wrapper_impl.
Definition fwd.hpp:41
disposable_wrapper_impl< interface_disposable > disposable_wrapper
Wrapper to keep "simple" disposable. Specialization of rpp::disposable_wrapper_impl.
Definition fwd.hpp:34
Definition disposables_strategy.hpp:51