|
| 1 | +<?xml version='1.0' encoding='utf-8' standalone='no'?> |
| 2 | +<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
| 3 | + |
| 4 | +<issue num="4203" status="New"> |
| 5 | +<title>constraints on `schedule_from`'s <i>`get-state`</i> function are incorrect</title> |
| 6 | +<section><sref ref="[exec.schedule.from]"/></section> |
| 7 | +<submitter>Eric Niebler</submitter> |
| 8 | +<date>03 Feb 2025</date> |
| 9 | +<priority>99</priority> |
| 10 | + |
| 11 | +<discussion> |
| 12 | +<p> |
| 13 | +Imported from <a href="https://github.com/cplusplus/sender-receiver/issues/313">cplusplus/sender-receiver #313</a>. |
| 14 | +</p> |
| 15 | +<p> |
| 16 | +<sref ref="[exec.schedule.from]"/> p6 reads: |
| 17 | + |
| 18 | +<blockquote> |
| 19 | +The member <code><i>impls-for</i><schedule_from_t>::get-state</code> |
| 20 | +is initialized with a callable object equivalent to the following lambda: |
| 21 | +<pre><code> |
| 22 | + []<class Sndr, class Rcvr>(Sndr&& sndr, Rcvr& rcvr) noexcept(<i>see below</i>) |
| 23 | + requires sender_in<<i>child-type</i><Sndr>, env_of_t<Rcvr>> { |
| 24 | +</code></pre> |
| 25 | +</blockquote> |
| 26 | + |
| 27 | +The constraint should account for the fact that the child sender will |
| 28 | +be connected with <code><i>FWD-ENV</i>(get_env(rcvr))</code>. |
| 29 | +</p> |
| 30 | + |
| 31 | +<note>The resolution touches the same text as LWG <iref ref="4198"/>.</note> |
| 32 | + |
| 33 | +</discussion> |
| 34 | + |
| 35 | +<resolution> |
| 36 | +<p> |
| 37 | +This wording is relative to <paper num="N5001"/>. |
| 38 | +</p> |
| 39 | + |
| 40 | +<ol> |
| 41 | +<li> |
| 42 | +Change <sref ref="[exec.snd.expos]"/> as indicated: |
| 43 | + |
| 44 | +<blockquote> |
| 45 | +-2- |
| 46 | +For a queryable object `env`, |
| 47 | +<code><i>FWD-ENV</i>(env)</code> is an expression whose |
| 48 | +type satisfies <i>`queryable`</i> such that for a query object `q` |
| 49 | +and a pack of subexpressions `as`, |
| 50 | +the expression <code><i>FWD-ENV</i>(env).query(q, as...)</code> |
| 51 | +is ill-formed if `forwarding_query(q)` is `false`; |
| 52 | +otherwise, it is expression-equivalent to `env.query(q, as...)`. |
| 53 | +<ins> |
| 54 | +The type <code><i>FWD-ENV-T</i>(Env)</code> is |
| 55 | +<code>decltype(<i>FWD-ENV</i>(declval<Env>()))</code>. |
| 56 | +</ins> |
| 57 | +</blockquote> |
| 58 | +</li> |
| 59 | + |
| 60 | +<li> |
| 61 | +Change <sref ref="[exec.schedule.from]"/> as indicated: |
| 62 | + |
| 63 | +<blockquote> |
| 64 | +-6- |
| 65 | +The member |
| 66 | +<code><i>impls-for</i><schedule_from_t>::<i>get-state</i></code> |
| 67 | +is initialized with a callable object equivalent to the following lambda: |
| 68 | +<pre><code> |
| 69 | + []<class Sndr, class Rcvr>(Sndr&& sndr, Rcvr& rcvr) noexcept(<i>see below</i>) |
| 70 | + requires sender_in<child-type<Sndr>, <ins><i>FWD-ENV-T</i>(</ins>env_of_t<Rcvr><ins>)</ins>> { |
| 71 | +</code></pre> |
| 72 | +<p>…</p> |
| 73 | +<p> |
| 74 | +-8- |
| 75 | +Let `Sigs` be a pack of the arguments to the `completion_signatures` |
| 76 | +specialization named by |
| 77 | +<code>completion_signatures_of_t<child-type<Sndr>, |
| 78 | + <ins><i>FWD-ENV-T</i>(</ins>env_of_t<Rcvr><ins>)</ins>></code>. |
| 79 | +Let <code><i>as-tuple</i></code> |
| 80 | +be an alias template that transforms a completion signature |
| 81 | +<code>Tag(Args...)</code> into the tuple specialization |
| 82 | +<code><i>decayed-tuple</i><Tag, Args...></code>. |
| 83 | +Then <code>variant_t</code> denotes the type |
| 84 | +<code>variant<monostate, as-tuple<Sigs>...></code>, |
| 85 | +except with duplicate types removed. |
| 86 | +</p> |
| 87 | +</blockquote> |
| 88 | +</li> |
| 89 | +</ol> |
| 90 | + |
| 91 | +</resolution> |
| 92 | + |
| 93 | +</issue> |
0 commit comments