-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Downlevel standard coroutine support #1730
Downlevel standard coroutine support #1730
Conversation
Allow `<coroutine>` to be included if `_DOWNLEVEL_COROUTINES_SUPPORTED` is defined even if `__cpp_lib_coroutine` is not. Allows use of standard coroutines in C++14 and C++17 modes with a compiler that permits it. Comparison operators are explicitly defined instead of <=> in these modes. Corresponding compiler changes are expected to come in 16.10.
Add /permissive- to the /Zc:preprocessor config. Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
- Move detection of downlevel coroutines to yvals_core.h in definition of __cpp_lib_coroutine. - Rework inclusion of <coroutine> in terms of __cpp_lib_coroutine, guard <compare> inclusion and spaceship definition in _HAS_CXX20. - C++14-ify the coroutine test.
Thanks for improving the past via time travel! 📅 🚀 🎉 😹 |
@@ -1296,6 +1292,10 @@ | |||
#define __cpp_lib_shared_ptr_arrays 201611L // P0497R0 Fixing shared_ptr For Arrays | |||
#endif // _HAS_CXX20 | |||
|
|||
#if defined(__cpp_impl_coroutine) || defined(_DOWNLEVEL_COROUTINES_SUPPORTED) // TRANSITION, Clang coroutine support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Late feedback: We should remove the TRANSITION
comment. Now that this is outside of _HAS_CXX20
, this condition is permanent. I hate to make a PR for a single comment cleanup. @stl (Sorry!) @StephanTLavavej, do you have a "miscellaneous cleanups" branch laying around you could add this change to, or should I start one of my own?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had recorded a todo about the matching comment being out of date (too small to reset testing), I’ll add this to that list, and fix it when we’re done with deadlines.
Allow
<coroutine>
to be included if_DOWNLEVEL_COROUTINES_SUPPORTED
is defined even if
__cpp_lib_coroutine
is not. Allows use of standardcoroutines in C++14 and C++17 modes with a compiler that supports it.
Comparison operators are explicitly defined instead of <=> in these
modes.
This mirrors the STL changes in internal MSVC-PR-309095.