cplusplus / cplusplus/draft

Reuse `class-type`?

Open
#7,175 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P3-Other
Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the exposition-only class-type concept in <execution> with the constraints on view_interface and range_adaptor_closure in <ranges>. Check the surrounding wording and issue discussion first, then determine whether reusing the concept is appropriate and whether the affected declarations can consistently use it.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.