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

Include <chrono> for high_resolution_clock #88

Merged
merged 1 commit into from
Nov 23, 2024

Conversation

StephanTLavavej
Copy link

I work on Microsoft Visual C++, where we regularly build popular open-source projects, including yours, with development builds of our compiler and libraries to detect and prevent shipping regressions that would affect you. This also allows us to provide advance notice of breaking changes, which is the case here.

I just merged microsoft/STL#5105, which revealed a conformance issue in cppcoro.

Compiler error with this STL change:

C:\gitP\andreasbuhr\cppcoro\test\cancellation_token_tests.cpp(294,28): error C3083: 'high_resolution_clock': the symbol to the left of a '::' must be a type

Affected code:

auto start = std::chrono::high_resolution_clock::now();

This was assuming that including <thread> makes the chrono::high_resolution_clock type available, which is not guaranteed by the Standard. You must explicitly include <chrono>.

@andreasbuhr
Copy link
Owner

Thanks a lot

@andreasbuhr andreasbuhr merged commit 9376645 into andreasbuhr:main Nov 23, 2024
@StephanTLavavej StephanTLavavej deleted the include-chrono branch November 23, 2024 23:00
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

Successfully merging this pull request may close these issues.

2 participants