[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
-
decltype(e) models queryable, and
-
e.query(get_stop_token) is expression-equivalent to state.stop-src.get_token(), and
-
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 it is instead forwarding all queries.
Proposed resolution:
Change [exec.snd.expos] p2 as follows (underlined text is new):
- For a queryable object
env, FWD-ENV(env) is an expression whose
type satisfies queryable such that for a query object q and a pack
of subexpressions as, the expression FWD-ENV(env).query(q, as...)
is ill-formed if forwarding_query(q) is false; otherwise, it is
expression-equivalent to env.query(q, as...).
The type FWD-ENV-T(Env) is decltype(FWD-ENV(declval<Env>())).
Change [exec.when.all] para 6 as follows:
- given a
query object q with type other than cv stop_token_tand whose type satisfies
forwarding-query, e.query(q) is expression-equivalent to get_env(rcvr).query(q).
Change the definition of make-state in [exec.when.all] para 7 as follows:
template<class Rcvr>
struct make-state {
- template<max-1-sender-in<env_of_t<Rcvr>>... Sndrs>
+ template<max-1-sender-in<FWD-ENV-T(env_of_t<Rcvr>)>... Sndrs>
Change para 9 as follows:
-
The alias values_tuple denotes the type
-tuple<value_types_of_t<Sndrs, env_of_t<Rcvr>, decayed-tuple, optional>...>
+tuple<value_types_of_t<Sndrs, FWD-ENV-T(env_of_t<Rcvr>), decayed-tuple, optional>...>
if that type is well-formed; otherwise, tuple<>.
[exec.when.all] p6 reads:
The problem is in (6.3). It should be forwarding on
forwarding-query's toget_env(rcvr)but it is instead forwarding all queries.Proposed resolution:
Change [exec.snd.expos] p2 as follows (underlined text is new):
Change [exec.when.all] para 6 as follows:
Change the definition of
make-statein [exec.when.all] para 7 as follows:Change para 9 as follows: