Description
[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)
modelsqueryable
, and
e.query(get_stop_token)
is expression-equivalent to state.stop-src.get_token(), andgiven a
query
objectq
with 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 satisfiesqueryable
such that for a query objectq
and 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
query
objectq
with type other than cvstop_token_t
and 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_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<>
.