Date
2025-02-03.20:20:12
Message id
14565

Content

[ The resolution touches some of the same text as LWG 4198, but without conflicting. ]

Imported from: cplusplus/sender-receiver #315.

[exec.when.all] p6 reads:

The member impls-for<when_all_t>::get-env is initialized with a callable object equivalent to the following lambda expression:
  []<class State, class Rcvr>(auto&&, State& state, const Receiver& rcvr) noexcept {
    return see below;
  }
Returns an object `e` such that
  1. (6.1) — `decltype(e)` models `queryable`, and
  2. (6.2) — `e.query(get_stop_token)` is expression-equivalent to state.stop-src.get_token(), and
  3. (6.3) — given a query object `q` with type other than cv `stop_token_t`, `e.query(q)` is expression-equivalent to `get_env(rcvr).query(q)`.
The problem is in (6.3). It should be forwarding on `forwarding-query`'s to `get_env(rcvr)` but is is instead forwarding all queries.

Imported from: cplusplus/sender-receiver #316.

The child senders should only see the parent's queries if they are forwarding queries.

Imported from: cplusplus/sender-receiver #311.

[exec.stopped.opt]/para 3 reads:

Let `sndr` and `env` be subexpressions such that `Sndr` is `decltype((sndr))` and `Env` is `decltype((env))`. If sender-for<Sndr, stopped_as_optional_t> is `false`, or if the type single-sender-value-type<Sndr, Env> is ill-formed or `void`, then the expression `stopped_as_optional.transform_sender(sndr, env)` is ill-formed; otherwise, it is equivalent to:
the test for single-sender-value-type<Sndr, Env> is incorrect. It should be testing its child for single-sender-ness.

In addition, it should be applying `FWD-ENV-T` to `Env` so that only forwarding queries are forwarded.