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

Check is_clock_v for thread utilities before C++20 #4585

Merged
merged 1 commit into from Apr 19, 2024

Conversation

frederick-vs-ja
Copy link
Contributor

This PR generalizes #1687 to C++14/17 modes and reimplements is_clock_v with a requires-expression. Towards #602.

In N4659 [time.point]/1, the Clock template parameter was required to meet the Clock (Cpp17Clock now) requirements. The requirement was changed by WG21-P0355R7 in C++20 and removed by WG21-P2212R2 in C++23.

All involved thread functions take a time_point parameter, so it was already invalid (probably UB) in C++11 to use these functions with an invalid time_point type. Static checking seems OK to me as we've been statically asserting is_standard_layout_v and is_trivial_v for basic_string.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner April 13, 2024 11:48
@StephanTLavavej StephanTLavavej changed the title Check "is_clock_v" for thread utilities before C++20 Check is_clock_v for thread utilities before C++20 Apr 13, 2024
@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Apr 13, 2024
@StephanTLavavej StephanTLavavej self-assigned this Apr 18, 2024
@StephanTLavavej
Copy link
Member

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

@StephanTLavavej StephanTLavavej merged commit f54203f into microsoft:main Apr 19, 2024
35 checks passed
@StephanTLavavej
Copy link
Member

Thanks for this timely improvement! ⌚ 🕥 😹

@frederick-vs-ja frederick-vs-ja deleted the pre-cxx20-is-clock branch April 19, 2024 02:22
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
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants