Skip to content

Use requires-clauses and concepts for miscellaneous C++20/23 components - #4637

Merged
Stephan T. Lavavej (StephanTLavavej) merged 3 commits into
microsoft:mainfrom
frederick-vs-ja:requires-for-misc-cxx20
May 20, 2024
Merged

Use requires-clauses and concepts for miscellaneous C++20/23 components#4637
Stephan T. Lavavej (StephanTLavavej) merged 3 commits into
microsoft:mainfrom
frederick-vs-ja:requires-for-misc-cxx20

Conversation

@frederick-vs-ja

@frederick-vs-ja A. Jiang (frederick-vs-ja) commented Apr 27, 2024

Copy link
Copy Markdown
Contributor

Notes:

  • Helper concepts are introduced to avoid constraints mismatch in forward declarations.
  • is_same_v is not replaced with same_as since the latter checks twice.
  • Containers, tuple, pair, and zoned_time are not yet touched. I think they should handled in concentrated following-up PRs.

MSVC is buggy on detection of forming an invalid reference type to a cv-/ref-qualified function type in a requires-expression. Reported DevCom-10648215.

Towards #602.

@frederick-vs-ja
A. Jiang (frederick-vs-ja) requested a review from a team as a code owner April 27, 2024 15:46
@frederick-vs-ja A. Jiang (frederick-vs-ja) changed the title Use requires-clause for miscellaneous C++20/23 components Use requires-clauses and concepts for miscellaneous C++20/23 components Apr 27, 2024
Notes:
- Helper concepts are introduced to avoid constraints mismatch.
- `is_same_v` is not replaced with `same_as` since the latter checks
twice.
- Containers, `tuple`, `pair`, and `zoned_time` are not yet touched.
I think they should handled in concentrated following-up PRs.
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for the extremely careful work here - this is an excellent improvement and significantly improves readability! 😻

@StephanTLavavej

Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit 23344e2 into microsoft:main May 20, 2024
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks again for these awesome simplifications! 😸 🪄 🎉

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

Labels

enhancement Something can be improved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants