|
| 1 | +<?xml version='1.0' encoding='utf-8' standalone='no'?> |
| 2 | +<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
| 3 | + |
| 4 | +<issue num="4461" status="New"> |
| 5 | +<title><i>`stop-when`</i> needs to evaluate unstoppable tokens</title> |
| 6 | +<section><sref ref="[exec.stop.when]"/></section> |
| 7 | +<submitter>Jonathan Wakely</submitter> |
| 8 | +<date>06 Nov 2025</date> |
| 9 | +<priority>99</priority> |
| 10 | + |
| 11 | +<discussion> |
| 12 | +<b>Addresses <a href="https://github.com/cplusplus/nbballot/issues/920">US 226-345</a></b> |
| 13 | +<p> |
| 14 | +For the case where `token` models `unstoppable_token` the expression that |
| 15 | +<i>`stop-when`</i> is expression-equivalent to needs to include the fact |
| 16 | +that `token` is evaluated (even if not used). |
| 17 | +</p> |
| 18 | +</discussion> |
| 19 | + |
| 20 | +<resolution> |
| 21 | +<p> |
| 22 | +This wording is relative to <paper num="N5014"/>. |
| 23 | +</p> |
| 24 | + |
| 25 | +<ol> |
| 26 | +<li><p>Modify <sref ref="[exec.stop.when]"/>, as indicated:</p> |
| 27 | + |
| 28 | +<blockquote> |
| 29 | +<p>-2- |
| 30 | +The name <i>`stop-when`</i> denotes an exposition-only sender adaptor. |
| 31 | +For subexpressions `sndr` and `token`: |
| 32 | +<ol style="list-style-type: none"> |
| 33 | +<li>(2.1) — |
| 34 | +If `decltype((sndr))` does not satisfy `sender`, |
| 35 | +or <code>remove_cvref_t<decltype((token))></code> |
| 36 | +does not satisfy `stoppable_token`, |
| 37 | +then <code><i>stop-when</i>(sndr, token)</code> is ill-formed. |
| 38 | +</li> |
| 39 | +<li>(2.2) — |
| 40 | +Otherwise, if <code>remove_cvref_t<decltype((token))></code> |
| 41 | +models `unstoppable_token` then <code><i>stop-when</i>(sndr, token)</code> |
| 42 | +is expression-equivalent to |
| 43 | +<code><ins>(void)token, </ins>sndr</code><ins>, except that `token` |
| 44 | +and `sndr` are indeterminately sequenced</ins>. |
| 45 | +</li> |
| 46 | +</ol> |
| 47 | +</p> |
| 48 | +</blockquote> |
| 49 | +</li> |
| 50 | +</ol> |
| 51 | + |
| 52 | +</resolution> |
| 53 | + |
| 54 | +</issue> |
0 commit comments