This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of WP status.
4208. Wording needs to ensure that inconnect(sndr, rcvr)
that rcvr
expression is only evaluated once
Section: 33.9.10 [exec.connect] Status: WP Submitter: Eric Niebler Opened: 2025-02-07 Last modified: 2025-06-23
Priority: Not Prioritized
View all issues with WP status.
Discussion:
Imported from cplusplus/sender-receiver #325.
The current wording of connect(sndr, rcvr)
defines the new_sndr
expression as transform_sender(decltype(get-domain-late(sndr, get_env(rcvr))){}, sndr, get_env(rcvr))
.
connect(sndr, rcvr)
as expression equivalent to new_sndr.connect(rcvr)
. As currently worded, this requires evaluating the rcvr
expression twice. Note that the first usage in the new_sndr
expression is unevaluated, but the second usage in get_env(rcvr)
is evaluated. I think we need to add an extra sentence at the end of this section saying "Where the expression rcvr
is only evaluated once." or similar.
[Hagenberg 2025-02-11; move to Ready]
[Sofia 2025-06-21; Status changed: Voting → WP.]
Proposed resolution:
This wording is relative to N5001.
Modify 33.9.10 [exec.connect] as indicated:
-6- The expression
connect(sndr, rcvr)
is expression-equivalent to:
(6.1) —
Mandates: The type of the expression above satisfiesnew_sndr.connect(rcvr)
if that expression is well-formed.operation_state
.(6.2) — Otherwise,
connect-awaitable(new_sndr, rcvr)
.except that
Mandates:rcvr
is evaluated only once.sender<Sndr> && receiver<Rcvr>
istrue
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4