Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

constraints on schedule_from's get-state function are incorrect #313

Open
ericniebler opened this issue Jan 19, 2025 · 0 comments
Open

constraints on schedule_from's get-state function are incorrect #313

ericniebler opened this issue Jan 19, 2025 · 0 comments
Labels
bug Something isn't working P1

Comments

@ericniebler
Copy link
Collaborator

ericniebler commented Jan 19, 2025

[exec.schedule.from] p6 reads:

The member impls-for<schedule_from_t>​::​get-state is initialized with a callable object equivalent to the following lambda:

[]<class Sndr, class Rcvr>(Sndr&& sndr, Rcvr& rcvr) noexcept(see below)
   requires sender_in<child-type<Sndr>, env_of_t<Rcvr>> {

The constraint should account for the fact that the child sender will be connected with FWD-ENV(get_env(rcvr)).

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.schedule.from] p6 as follows:

The member `impls-for<schedule_from_t>​::​get-state` is initialized with
a callable object equivalent to the following lambda:

  []<class Sndr, class Rcvr>(Sndr&& sndr, Rcvr& rcvr) noexcept(see below)
-   requires sender_in<child-type<Sndr>, env_of_t<Rcvr>> {
+   requires sender_in<child-type<Sndr>, FWD-ENV-T(env_of_t<Rcvr>)> {

Change [exec.schedule.from] p8 as follows:

Let Sigs be a pack of the arguments to the completion_signatures
specialization named by
-completion_signatures_of_t<child-type<Sndr>, env_of_t<Rcvr>>. Let
+completion_signatures_of_t<child-type<Sndr>, FWD-ENV-T(env_of_t<Rcvr>)>. Let
as-tuple be an alias template that transforms a completion signature
Tag(Args...) into the tuple specialization decayed-tuple<Tag, Args...>.
Then variant_t denotes the type variant<monostate, as-tuple<Sigs>...>,
except with duplicate types removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1
Projects
None yet
Development

No branches or pull requests

1 participant