5 #ifndef DOXYGEN_SKIP_PROPERTY
8 template<
class _Ty,
bool _Optional>
9 struct channel_impl_v2;
12 inline namespace channel_v2
14 #endif //DOXYGEN_SKIP_PROPERTY
24 template<
class _Ty =
bool,
bool _Optional = !std::is_trivial_v<_Ty>,
bool _OptimizationThread = false>
27 static_assert((std::is_copy_constructible_v<_Ty>&& std::is_copy_assignable_v<_Ty>) ||
28 (std::is_move_constructible_v<_Ty> && std::is_move_assignable_v<_Ty>));
30 struct [[nodiscard]] read_awaiter;
31 struct [[nodiscard]] write_awaiter;
42 size_t capacity()
const noexcept;
49 read_awaiter
operator co_await()
const noexcept;
59 read_awaiter read()
const noexcept;
66 #ifndef DOXYGEN_SKIP_PROPERTY
67 COMMA_RESUMEF_ENABLE_IF(std::is_constructible_v<_Ty, U&&>)
68 #endif //DOXYGEN_SKIP_PROPERTY
70 #ifndef DOXYGEN_SKIP_PROPERTY
71 RESUMEF_REQUIRES(std::is_constructible_v<_Ty, U&&>)
72 #endif //DOXYGEN_SKIP_PROPERTY
73 write_awaiter operator << (U&& val)
const noexcept(std::is_move_constructible_v<U>);
83 #ifndef DOXYGEN_SKIP_PROPERTY
84 COMMA_RESUMEF_ENABLE_IF(std::is_constructible_v<_Ty, U&&>)
85 #endif //DOXYGEN_SKIP_PROPERTY
87 #ifndef DOXYGEN_SKIP_PROPERTY
88 RESUMEF_REQUIRES(std::is_constructible_v<_Ty, U&&>)
89 #endif //DOXYGEN_SKIP_PROPERTY
90 write_awaiter write(U&& val)
const noexcept(std::is_move_constructible_v<U>);
93 #ifndef DOXYGEN_SKIP_PROPERTY
94 using value_type = _Ty;
96 static constexpr
bool use_optional = _Optional;
97 static constexpr
bool optimization_for_multithreading = _OptimizationThread;
99 using optional_type = std::conditional_t<use_optional, std::optional<value_type>, value_type>;
100 using channel_type = detail::channel_impl_v2<value_type, use_optional>;
101 using lock_type =
typename channel_type::lock_type;
108 std::shared_ptr<channel_type> _chan;
109 #endif //DOXYGEN_SKIP_PROPERTY
113 #ifndef DOXYGEN_SKIP_PROPERTY
115 template<
bool _Option,
bool _OptimizationThread>
116 struct channel_t<void, _Option, _OptimizationThread>
119 #endif //DOXYGEN_SKIP_PROPERTY
124 using semaphore_t = channel_t<bool, false, true>;