|
| 1 | +<?xml version='1.0' encoding='utf-8' standalone='no'?> |
| 2 | +<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
| 3 | + |
| 4 | +<issue num="4199" status="New"> |
| 5 | +<title>constraints on user customizations of standard sender algorithms are incorrectly specified</title> |
| 6 | +<section><sref ref="[exec.snd.general]"/></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/308">cplusplus/sender-receiver #308</a>. |
| 14 | +</p> |
| 15 | +<p> |
| 16 | +<sref ref="[exec.snd.general]"/>/p1 reads: |
| 17 | + |
| 18 | +<blockquote> |
| 19 | +Subclauses <sref ref="[exec.factories]"/> and <sref ref="[exec.adapt]"/> define |
| 20 | +customizable algorithms that return senders. |
| 21 | +Each algorithm has a default implementation. |
| 22 | +Let `sndr` be the result of an invocation of such an algorithm |
| 23 | +or an object equal to the result (<sref ref="[concepts.equality]"/>), |
| 24 | +and let `Sndr` be `decltype((sndr))`. |
| 25 | +Let `rcvr` be a receiver of type `Rcvr` with associated environment `env` |
| 26 | +of type `Env` such that <code>sender_to<Sndr, Rcvr></code> is `true`. |
| 27 | +For the default implementation of the algorithm that produced `sndr`, |
| 28 | +connecting `sndr` to `rcvr` and starting the resulting operation state |
| 29 | +(<sref ref="[exec.async.ops]"/>) necessarily results in the potential evaluation |
| 30 | +(<sref ref="[basic.def.odr]"/>) of a set of completion operations |
| 31 | +whose first argument is a subexpression equal to `rcvr`. |
| 32 | +Let `Sigs` be a pack of completion signatures corresponding to this set |
| 33 | +of completion operations. |
| 34 | +<u><b> |
| 35 | +Then the type of the expression `get_completion_signatures(sndr, env)` |
| 36 | +is a specialization of the class template `completion_signatures` |
| 37 | +(<sref ref="[exec.util.cmplsig]"/>), the set of whose template arguments is `Sigs`. |
| 38 | +</b></u> |
| 39 | +If a user-provided implementation of the algorithm that produced `sndr` |
| 40 | +is selected instead of the default, any completion signature that is in |
| 41 | +the set of types denoted by |
| 42 | +<code>completion_signatures_of_t<Sndr, Env></code> |
| 43 | +and that is not part of `Sigs` |
| 44 | +shall correspond to error or stopped completion operations, |
| 45 | +unless otherwise specified. |
| 46 | +</blockquote> |
| 47 | +The emphasized sentence is the problem. Since <paper num="P2300"/> |
| 48 | +got lazy customization, |
| 49 | +the expression `get_completion_signatures(snd, env)` |
| 50 | +could dispatch to a customization. |
| 51 | +We should define a low-level exposition-only |
| 52 | +<i>`get-completion-signatures`</i> |
| 53 | +function that does the same as `get_completion_signatures` |
| 54 | +except without the sender transformation. |
| 55 | +Then we can express `get_completion_signatures` in terms of that. |
| 56 | +</p> |
| 57 | +</discussion> |
| 58 | + |
| 59 | +<resolution> |
| 60 | +<p> |
| 61 | +</p> |
| 62 | +</resolution> |
| 63 | + |
| 64 | +</issue> |
0 commit comments