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

Reuse class-type? #7175

Open
hewillk opened this issue Jul 28, 2024 · 2 comments
Open

Reuse class-type? #7175

hewillk opened this issue Jul 28, 2024 · 2 comments

Comments

@hewillk
Copy link
Contributor

hewillk commented Jul 28, 2024

<execution> introduces the following exposition-only concepts:

template<class From, class To>
  concept decays-to = same_as<decay_t<From>, To>;             // exposition only

 template<class T>
  concept class-type = decays-to<T, T> && is_class_v<T>;      // exposition only

which used to constrain

// [[exec.adapt]], sender adaptors
template<class-type D>
  struct sender_adaptor_closure { };

This is basically similar to the constraints we have for view_interface and range_adaptor_closure in <ranges>:

template<class D>
  requires is_class_v<D> && same_as<D, remove_cv_t<D>>
class view_interface;

template<class D>
  requires is_class_v<D> && same_as<D, remove_cv_t<D>>
class range_adaptor_closure { };

Not sure if reusing the class-type is worth the simplification (if LWG is needed):

template<class-type D>
class view_interface;

template<class-type D>
class range_adaptor_closure { };
@jensmaurer
Copy link
Member

This feels editorial to me. I prefer the formulation in view_interface, however. Moving the definition of class-type to [expos.only.entity] seems in order. Can we then get rid of decays-to entirely?

@jwakely ?

@hewillk
Copy link
Contributor Author

hewillk commented Jul 30, 2024

This feels editorial to me. I prefer the formulation in view_interface, however. Moving the definition of class-type to [expos.only.entity] seems in order. Can we then get rid of decays-to entirely?

@jwakely ?

decays-to seems to be a very common concept, and I believe it is used in some form or another in the standard. Perhaps we can reuse decays-to, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants