|
| 1 | +<?xml version='1.0' encoding='utf-8' standalone='no'?> |
| 2 | +<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
| 3 | + |
| 4 | +<issue num="4360" status="New"> |
| 5 | +<title><tt><i>awaitable-sender</i></tt> concept should qualify use of <tt><i>awaitable-receiver</i></tt> type</title> |
| 6 | +<section> |
| 7 | +<sref ref="[exec.as.awaitable]"/> |
| 8 | +</section> |
| 9 | +<submitter>Lewis Baker</submitter> |
| 10 | +<date>27 Aug 2025</date> |
| 11 | +<priority>99</priority> |
| 12 | + |
| 13 | +<discussion> |
| 14 | +<p> |
| 15 | +In <sref ref="[exec.as.awaitable]"/> p1 there is an exposition-only helper concept |
| 16 | +<tt><i>awaitable-sender</i></tt> defined as follows: |
| 17 | +</p> |
| 18 | +<blockquote><pre> |
| 19 | +namespace std::execution { |
| 20 | + template<class Sndr, class Promise> |
| 21 | + concept <i>awaitable-sender</i> = |
| 22 | + <i>single-sender</i><Sndr, env_of_t<Promise>> && |
| 23 | + sender_to<Sndr, <i>awaitable-receiver</i>> && // <i>see below</i> |
| 24 | + requires (Promise& p) { |
| 25 | + { p.unhandled_stopped() } -> convertible_to<coroutine_handle<>>; |
| 26 | + }; |
| 27 | +} |
| 28 | +</pre></blockquote> |
| 29 | +<p> |
| 30 | +The mention of the type <tt><i>awaitable-receiver</i></tt> here does not refer to any exposition-only type |
| 31 | +defined at namespace-scope. It seems to, instead, be referring to the nested member-type |
| 32 | +<tt><i>sender-awaitable</i><Sndr, Promise>::<i>awaitable-receiver</i></tt> and so should be |
| 33 | +qualified as such. |
| 34 | +</p> |
| 35 | +</discussion> |
| 36 | + |
| 37 | +<resolution> |
| 38 | +<p> |
| 39 | +This wording is relative to <paper num="N5014"/>. |
| 40 | +</p> |
| 41 | + |
| 42 | +<ol> |
| 43 | + |
| 44 | +<li><p>Modify <sref ref="[exec.as.awaitable]"/> as indicated:</p> |
| 45 | + |
| 46 | +<blockquote> |
| 47 | +<p> |
| 48 | +-1- `as_awaitable` transforms an object into one that is awaitable within a particular coroutine. |
| 49 | +Subclause <sref ref="[exec.coro.util]"/> makes use of the following exposition-only entities: |
| 50 | +</p> |
| 51 | +<blockquote><pre> |
| 52 | +namespace std::execution { |
| 53 | + template<class Sndr, class Promise> |
| 54 | + concept <i>awaitable-sender</i> = |
| 55 | + <i>single-sender</i><Sndr, env_of_t<Promise>> && |
| 56 | + sender_to<Sndr, <ins>typename <i>sender-awaitable</i><Sndr, Promise>::</ins><i>awaitable-receiver</i>> && // <i>see below</i> |
| 57 | + requires (Promise& p) { |
| 58 | + { p.unhandled_stopped() } -> convertible_to<coroutine_handle<>>; |
| 59 | + }; |
| 60 | + […] |
| 61 | +} |
| 62 | +</pre></blockquote> |
| 63 | +</blockquote> |
| 64 | + |
| 65 | +</li> |
| 66 | + |
| 67 | +</ol> |
| 68 | +</resolution> |
| 69 | + |
| 70 | +</issue> |
0 commit comments