18 template<concepts::ExecutionContext Context>
21 template<
typename Context>
35 template<concepts::ExecutionContext Context>
38 template<
typename Result,
typename Context>
44 explicit Type(
Result* result, Context* context) : m_result(result), m_context(context) {}
47 template<
typename... Values>
51 self.m_result->emplace(util::forward<Values>(values)...);
52 self.m_context->finish();
57 *self.m_result =
Unexpected(util::move(error));
58 self.m_context->finish();
61 *self.m_result =
Unexpected(BasicError::OperationCanceled);
62 self.m_context->finish();
74 template<
typename Result, concepts::ExecutionContext Context>
77 template<concepts::ExecutionContext Context, concepts::SenderIn<Env<Context>> Send>
80 template<concepts::ExecutionContext Context, concepts::SenderIn<Env<Context>> Send>
89 template<concepts::ExecutionContext Context, concepts::SenderIn<Env<Context>> Send>
91 if constexpr (
requires {
93 util::forward<Send>(sender));
96 util::forward<Send>(sender));
97 }
else if constexpr (
requires {
function::tag_invoke(*
this, context, util::forward<Send>(sender)); }) {
101 "sync_wait() cannot be called on sequences. Use a sequence consumer like ignore_all() or "
102 "first_value() before sync_wait().");
108 util::addressof(value.value), util::addressof(context)));
113 return util::move(value.value);
119 template<concepts::ExecutionContext Context, concepts::SenderIn<Env<Context>> Send>
122 if constexpr (
requires {
124 util::forward<Send>(sender));
127 util::forward<Send>(sender));
128 }
else if constexpr (
requires {
function::tag_invoke(*
this, context, util::forward<Send>(sender)); }) {
137 template<concepts::SenderIn<Env<RunLoop<>>> Send>
139 if constexpr (
requires {
141 util::forward<Send>(sender));
144 util::forward<Send>(sender));
149 return OnFunction {}(run_loop, util::forward<Send>(sender));
155 template<concepts::SenderIn<Env<RunLoop<>>> Send>
157 if constexpr (
requires {
159 util::forward<Send>(sender));
162 util::forward<Send>(sender));
Definition unexpected.h:14
This concept is used with static_assert() to cause the static assert to fail only when the template h...
Definition core.h:98
Definition sequence_sender.h:102
vocab::Result< meta::ValueTypesOf< Send, Env, ResultTypeImpl::template Invoke, ResultTypeConcatImpl::template Invoke > > ResultType
Definition into_result.h:57
vocab::Result< into_variant_ns::IntoVariantType< Send, Env > > WithVariantResultType
Definition into_result.h:61
Definition sync_wait.h:17
meta::Type< EnvT< Context > > Env
Definition sync_wait.h:36
meta::ExecutionContextScheduler< Context > Scheduler
Definition sync_wait.h:19
into_result_ns::WithVariantResultType< Env< Context >, Send > WithVariantResultType
Definition sync_wait.h:81
meta::Type< ReceiverT< Result, Context > > Receiver
Definition sync_wait.h:75
into_result_ns::ResultType< Env< Context >, Send > ResultType
Definition sync_wait.h:78
constexpr auto start
Definition start.h:20
constexpr auto into_variant
Definition into_variant.h:86
constexpr auto sync_wait_with_variant_on
Definition sync_wait.h:176
constexpr auto get_completion_scheduler
Definition get_completion_scheduler.h:19
constexpr auto get_env
Definition get_env.h:27
constexpr auto sync_wait_on
Definition sync_wait.h:175
constexpr auto connect
Definition connect.h:42
constexpr auto sync_wait
Definition sync_wait.h:172
constexpr auto sync_wait_with_variant
Definition sync_wait.h:173
constexpr tag_invoke_detail::TagInvokeFn tag_invoke
Definition tag_invoke.h:22
constexpr auto curry
Definition curry.h:140
di::meta::Decay< decltype(T)> Tag
Definition tag_invoke.h:28
auto declval() -> meta::AddRValueReference< T >
Definition declval.h:8
Expected< T, Error > Result
Definition result.h:8
StatusCode< Erased< long > > Error
Definition error.h:8
Definition zstring_parser.h:9
Defines the sequence sender concepts and related CPOs.
Definition set_stopped.h:6
Definition sync_wait.h:23
constexpr friend auto tag_invoke(types::Tag< get_scheduler >, Type const &self)
Definition sync_wait.h:28
Scheduler< Context > scheduler
Definition sync_wait.h:25
constexpr friend auto tag_invoke(types::Tag< get_delegatee_scheduler >, Type const &self)
Definition sync_wait.h:29
Definition sync_wait.h:22
Definition sync_wait.h:136
auto operator()(Send &&sender) const -> concepts::SameAs< ResultType< RunLoop<>, Send > > auto
Definition sync_wait.h:138
Definition sync_wait.h:88
auto operator()(Context &context, Send &&sender) const -> concepts::SameAs< ResultType< Context, Send > > auto
Definition sync_wait.h:90
friend void tag_invoke(SetError, Type &&self, Error error)
Definition sync_wait.h:55
void is_receiver
Definition sync_wait.h:42
friend void tag_invoke(SetStopped, Type &&self)
Definition sync_wait.h:60
Type(Result *result, Context *context)
Definition sync_wait.h:44
constexpr friend auto tag_invoke(types::Tag< get_env >, Type const &self)
Definition sync_wait.h:65
friend auto tag_invoke(SetValue, Type &&self, Values &&... values)
Definition sync_wait.h:48
Definition sync_wait.h:39
Definition sync_wait.h:84
T value
Definition sync_wait.h:85
Definition sync_wait.h:154
auto operator()(Send &&sender) const -> concepts::SameAs< WithVariantResultType< RunLoop<>, Send > > auto
Definition sync_wait.h:156
Definition sync_wait.h:118
auto operator()(Context &context, Send &&sender) const -> concepts::SameAs< WithVariantResultType< Context, Send > > auto
Definition sync_wait.h:120