-
Notifications
You must be signed in to change notification settings - Fork 5
Description
[exec.when.all] p6 reads:
The member
impls-for<when_all_t>::get-envis 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)modelsqueryable, and
e.query(get_stop_token)is expression-equivalent to state.stop-src.get_token(), andgiven a
queryobjectqwith type other than cvstop_token_t,e.query(q)is
expression-equivalent toget_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 satisfiesqueryablesuch that for a query objectqand a pack
of subexpressionsas, the expressionFWD-ENV(env).query(q, as...)
is ill-formed ifforwarding_query(q)isfalse; otherwise, it is
expression-equivalent toenv.query(q, as...).
The typeFWD-ENV-T(Env)isdecltype(FWD-ENV(declval<Env>())).
Change [exec.when.all] para 6 as follows:
- given a
queryobjectqwith type other than cvstop_token_tand whose type satisfies
forwarding-query,e.query(q)is expression-equivalent toget_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_tupledenotes 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<>.