Skip to content

Reuse class-type? #7175

Open
Open
@hewillk

Description

@hewillk

<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 { };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions