Created on 2025-08-27.00:00:00 last changed 1 month ago
Proposed resolution:
This wording is relative to N5014.
Modify [exec.connect] as indicated:
-5- Let `V` name the type await-result-type<DS, connect-awaitable-promise>, let `Sigs` name the type
completion_signatures< SET-VALUE-SIG(V), // see [exec.snd.concepts] set_error_t(exception_ptr), set_stopped_t()>and let connect-awaitable be an exposition-only coroutine defined as follows:
namespace std::execution { […] operation-state-task connect-awaitable(DS sndr, DR rcvr) requires receiver_of<DR, Sigs> { exception_ptr ep; try { if constexpr (same_as<V, void>is_void_v<V>) { co_await std::move(sndr); co_await suspend-complete(set_value, std::move(rcvr)); } else { co_await suspend-complete(set_value, std::move(rcvr), co_await std::move(sndr)); } } catch(...) { ep = current_exception(); } co_await suspend-complete(set_error, std::move(rcvr), std::move(ep)); } }
[ 2025-10-23; Reflector poll. ]
Set priority to 4 after reflector poll.
"NAD, `V` is await-result-type<...> which is `decltype(...)`
and you never get cv void from `decltype` ([expr.type] p2)."
"But using `is_void_v` more clearly expresses the intent."
The wording in [exec.connect] p5 defines the connect-awaitable() function as follows:
operation-state-task connect-awaitable(DS sndr, DR rcvr) requires receiver_of<DR, Sigs> {
exception_ptr ep;
try {
if constexpr (same_as<V, void>) {
co_await std::move(sndr);
co_await suspend-complete(set_value, std::move(rcvr));
} else {
co_await suspend-complete(set_value, std::move(rcvr), co_await std::move(sndr));
}
} catch(...) {
ep = current_exception();
}
co_await suspend-complete(set_error, std::move(rcvr), std::move(ep));
}
The use of same_as<V, void> in the if-constexpr condition does not cover the case where the result of the `co_await` expression has type cv `void`. It should use is_void_v<V> instead to allow it to match all `void` types, not just unqualified `void`.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2025-10-23 12:39:14 | admin | set | messages: + msg15401 |
| 2025-09-14 11:21:22 | admin | set | messages: + msg15030 |
| 2025-08-27 00:00:00 | admin | create | |