Title
Bad expression in [exec.when.all]
Status
wp
Section
[exec.when.all]
Submitter
Eric Niebler

Created on 2025-10-30.00:00:00 last changed 1 week ago

Messages

Date: 2025-11-11.10:48:55

Proposed resolution:

This wording is relative to N5014.

  1. Modify [exec.when.all] as indicated:

    -5- Let make-when-all-env be the following exposition-only function template:

    template<class Env>
      constexpr auto make-when-all-env(inplace_stop_source& stop_src,        // exposition only
                                       Env&& env) noexcept; {
      return see below;
    }
    

    -?- Returns: An Returns and object `e` such that

    • (5.1) — `decltype(e)` models queryable, and
    • (5.2) — `e.query(get_stop_token)` is expression-equivalent to state.stop-srcstop_src.get_token(), and
    • (5.3) — given a query object `q` with type other than cv `get_stop_token_t` and whose type satisfies forwarding-query, `e.query(q)` is expression-equivalent to `get_env(rcvr)``env``.query(q)` if the type of `q` satisfies `forwarding-query`, and ill-formed otherwise.
Date: 2025-11-11.10:48:55

[ Kona 2025-11-08; Status changed: Immediate → WP. ]

Date: 2025-11-06.03:02:09

[ Kona 2025-11-06; approved by LWG. Status changed: New → Immediate. ]

Date: 2025-11-05.02:59:29

[ Kona 2025-11-04; add edits to address NB comments. ]

Date: 2025-11-05.02:59:29
Addresses US 220-344 and US 224-342

[exec.when.all] p5 reads as follows:

-5- Let make-when-all-env be the following exposition-only function template:

template<class Env>
  constexpr auto make-when-all-env(inplace_stop_source& stop_src,        // exposition only
                                   Env&& env) noexcept {
  return see below;
}

Returns an object `e` such that

  • (5.1) — `decltype(e)` models queryable, and
  • (5.2) — `e.query(get_stop_token)` is expression-equivalent to state.stop-src.get_token(), and
  • (5.3) — given a query object `q` with type other than cv `stop_token_t` and whose type satisfies forwarding-query, `e.query(q)` is expression-equivalent to `get_env(rcvr).query(q)`.

The problem is with "state.stop-src.get_token()" in bullet (5.2). There is no `state` object here. This expression should be `stop_src.get_token()`.

History
Date User Action Args
2025-11-11 10:48:55adminsetmessages: + msg15691
2025-11-11 10:48:55adminsetstatus: immediate -> wp
2025-11-06 03:02:09adminsetmessages: + msg15549
2025-11-06 03:02:09adminsetstatus: new -> immediate
2025-11-05 01:50:10adminsetmessages: + msg15510
2025-10-31 11:33:06adminsetmessages: + msg15477
2025-10-30 00:00:00admincreate