A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/cplusplus/sender-receiver/issues/315 below:

`when_all`'s receiver's environment is incorrectly forwarding all queries · Issue #315 · cplusplus/sender-receiver · GitHub

[exec.when.all] p6 reads:

  1. 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. decltype(e) models queryable, and

    2. e.query(get_stop_token) is expression-equivalent to state.stop-src.get_token(), and

    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 it is instead forwarding all queries.

Proposed resolution:

Change [exec.snd.expos] p2 as follows (underlined text is new):

  1. 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:

  1. 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).

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:

  1. 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<>.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4