|
| 1 | +<?xml version='1.0' encoding='utf-8' standalone='no'?> |
| 2 | +<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
| 3 | + |
| 4 | +<issue num="4213" status="New"> |
| 5 | +<title>Sender spec depends on unspecified order of evaluation</title> |
| 6 | +<section> |
| 7 | +<sref ref="[exec.snd]"/> |
| 8 | +</section> |
| 9 | +<submitter>Frank Birbacher</submitter> |
| 10 | +<date>14 Feb 2025</date> |
| 11 | +<priority>99</priority> |
| 12 | + |
| 13 | +<discussion> |
| 14 | +<p> |
| 15 | +In certain clauses for defining senders the unspecified order of evaluation of function arguments can |
| 16 | +lead to retrieving values from a move-from state of a sender. An example is <sref ref="[exec.continues.on]"/> |
| 17 | +where paragraph 3 states: |
| 18 | +</p> |
| 19 | +<blockquote><pre> |
| 20 | +transform_sender(<i>get-domain-early</i>(sndr), <i>make-sender</i>(continues_on, sch, sndr)) |
| 21 | +</pre></blockquote> |
| 22 | +<p> |
| 23 | +In this expression the evaluation of <tt><i>get-domain-early</i>(sndr)</tt> can happen before or after |
| 24 | +the <tt><i>make-sender</i></tt>. The latter can steal the value from `sndr` by moving from it. So |
| 25 | +<tt><i>get-domain-early</i></tt> may see the moved-from state of `sndr` and fail to obtain anything. |
| 26 | +<p/> |
| 27 | +Repetitions are at least in: |
| 28 | +</p> |
| 29 | +<ol> |
| 30 | +<li><p><sref ref="[exec.then]"/> p3</p></li> |
| 31 | +<li><p><sref ref="[exec.let]"/> p4</p></li> |
| 32 | +<li><p><sref ref="[exec.bulk]"/> p2</p></li> |
| 33 | +<li><p><sref ref="[exec.split]"/> p4</p></li> |
| 34 | +<li><p><sref ref="[exec.when.all]"/> p3</p></li> |
| 35 | +<li><p><sref ref="[exec.into.variant]"/> p3</p></li> |
| 36 | +<li><p><sref ref="[exec.stopped.opt]"/> p2</p></li> |
| 37 | +<li><p><sref ref="[exec.stopped.err]"/> p2</p></li> |
| 38 | +<li><p><sref ref="[exec.sync.wait.var]"/> p1</p></li> |
| 39 | +</ol> |
| 40 | +</discussion> |
| 41 | + |
| 42 | +<resolution> |
| 43 | +</resolution> |
| 44 | + |
| 45 | +</issue> |
0 commit comments