Skip to content

scheduler concept is missing a requirement regarding domains #338

Open
@ericniebler

Description

@ericniebler
Collaborator

get_domain(sch) returns the domain tag of sch's associated execution context. so too does get_domain(get_env(schedule(sch))). nothing is currently requiring them to have the same type.

Proposed resolution

Change the scheduler concept as follows:

namespace std::execution {
  template<class Env>
    using domain-of-t =                       // exposition only
      decltype(auto(query-with-default(get_domain, declval<Env>(), default_domain())));

  template<class Sch>
    concept scheduler =
      derived_from<typename remove_cvref_t<Sch>::scheduler_concept, scheduler_t> &&
      queryable<Sch> &&
      requires(Sch&& sch) {
        { schedule(std::forward<Sch>(sch)) } -> sender;
        { auto(get_completion_scheduler<set_value_t>(
            get_env(schedule(std::forward<Sch>(sch))))) }
              -> same_as<remove_cvref_t<Sch>>;
      } &&
      same_as<domain-of-t<Sch>, domain-of-t<env_of_t<decltype(schedule(declval<Sch>()))>>> &&
      equality_comparable<remove_cvref_t<Sch>> &&
      copyable<remove_cvref_t<Sch>>;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ericniebler

        Issue actions

          `scheduler` concept is missing a requirement regarding domains · Issue #338 · cplusplus/sender-receiver