Skip to content

Commit 374043d

Browse files
committed
start, set_value, set_error, and set_stopped may return a tail_sender
1 parent 5699467 commit 374043d

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

include/stdexec/execution.hpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,10 @@ namespace stdexec {
334334
template <class _Receiver, class... _As>
335335
requires tag_invocable<set_value_t, _Receiver, _As...>
336336
STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
337-
void operator()(_Receiver&& __rcvr, _As&&... __as) const noexcept {
337+
auto operator()(_Receiver&& __rcvr, _As&&... __as) const noexcept
338+
-> tag_invoke_result_t<set_value_t, _Receiver, _As...> {
338339
static_assert(nothrow_tag_invocable<set_value_t, _Receiver, _As...>);
339-
(void) tag_invoke(set_value_t{}, (_Receiver&&) __rcvr, (_As&&) __as...);
340+
return tag_invoke(set_value_t{}, (_Receiver&&) __rcvr, (_As&&) __as...);
340341
}
341342
};
342343

@@ -348,9 +349,10 @@ namespace stdexec {
348349
template <class _Receiver, class _Error>
349350
requires tag_invocable<set_error_t, _Receiver, _Error>
350351
STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
351-
void operator()(_Receiver&& __rcvr, _Error&& __err) const noexcept {
352+
auto operator()(_Receiver&& __rcvr, _Error&& __err) const noexcept
353+
-> tag_invoke_result_t<set_error_t, _Receiver, _Error> {
352354
static_assert(nothrow_tag_invocable<set_error_t, _Receiver, _Error>);
353-
(void) tag_invoke(set_error_t{}, (_Receiver&&) __rcvr, (_Error&&) __err);
355+
return tag_invoke(set_error_t{}, (_Receiver&&) __rcvr, (_Error&&) __err);
354356
}
355357
};
356358

@@ -362,9 +364,10 @@ namespace stdexec {
362364
template <class _Receiver>
363365
requires tag_invocable<set_stopped_t, _Receiver>
364366
STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
365-
void operator()(_Receiver&& __rcvr) const noexcept {
367+
auto operator()(_Receiver&& __rcvr) const noexcept
368+
-> tag_invoke_result_t<set_stopped_t, _Receiver> {
366369
static_assert(nothrow_tag_invocable<set_stopped_t, _Receiver>);
367-
(void) tag_invoke(set_stopped_t{}, (_Receiver&&) __rcvr);
370+
return tag_invoke(set_stopped_t{}, (_Receiver&&) __rcvr);
368371
}
369372
};
370373
} // namespace __receivers
@@ -1210,8 +1213,9 @@ namespace stdexec {
12101213
struct start_t {
12111214
template <class _Op>
12121215
requires tag_invocable<start_t, _Op&>
1213-
void operator()(_Op& __op) const noexcept(nothrow_tag_invocable<start_t, _Op&>) {
1214-
(void) tag_invoke(start_t{}, __op);
1216+
auto operator()(_Op& __op) const noexcept(nothrow_tag_invocable<start_t, _Op&>)
1217+
-> tag_invoke_result_t<start_t, _Op&> {
1218+
return tag_invoke(start_t{}, __op);
12151219
}
12161220
};
12171221
}

0 commit comments

Comments
 (0)