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

restore the enable_sender boolean variable template #306

Open
ericniebler opened this issue Dec 5, 2024 · 0 comments
Open

restore the enable_sender boolean variable template #306

ericniebler opened this issue Dec 5, 2024 · 0 comments
Labels
bug Something isn't working P0

Comments

@ericniebler
Copy link
Collaborator

as described in issue #305, enable_sender variable template was an important way to opt in to sender-ness, particularly for types that are awaitable, but only in certain contexts. this functionality was lost during wording review(?) when enable_sender got turned into an exposition-only enable-sender concept.

we should roll back that change.

  template<class Sndr>
    concept is-sender =                                         // exposition only
      derived_from<typename Sndr::sender_concept, sender_t>;

  template<class Sndr>
    concept enable-sender =                                     // exposition only
      is-sender<Sndr> ||
      is-awaitable<Sndr, env-promise<empty_env>>;               // [exec.awaitable]

+ template<class Sndr>
+   inline constexpr bool enable_sender = enable-sender<Sndr>;

  template<class Sndr>
    concept sender =
-     bool(enable-sender<remove_cvref_t<Sndr>>) &&
+     enable_sender<remove_cvref_t<Sndr>> &&
      requires (const remove_cvref_t<Sndr>& sndr) {
        { get_env(sndr) } -> queryable;
      } &&
      move_constructible<remove_cvref_t<Sndr>> &&
      constructible_from<remove_cvref_t<Sndr>, Sndr>;

we also need the standardese permitting users to specialize enable_sender.

@ericniebler ericniebler added bug Something isn't working P0 labels Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0
Projects
None yet
Development

No branches or pull requests

1 participant