-
Notifications
You must be signed in to change notification settings - Fork 262
Define co_await operators for C++20 coroutines #765
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
Conversation
|
/azp run |
|
No pipelines are associated with this pull request. |
|
Thanks Koby, this looks reasonable but I'd prefer to change the definition in one place rathe than duplicate it. Perhaps you can experiment with updating the following? This needs to support both C++20 and C++17 with the Visual C++ cppwinrt/strings/base_macros.h Lines 30 to 32 in 714c085
|
I assume you mean define a cppwinrt-specific macro here and use it, rather than define the Coroutines TS feature test macro in C++20 coroutines mode too, right? I'll update the PR accordingly. |
|
Perhaps the base_macros.h would look something like this: #if defined(_RESUMABLE_FUNCTIONS_SUPPORTED) && !defined(__cpp_lib_coroutine)
#define __cpp_lib_coroutine
#endif And then subsequent checks would simply test for the C++20 feature macro. I think that would work, although I haven't tested it. |
|
Couldn't that mislead other libraries which use the macro for feature detection as well? |
|
Perhaps - then we should define a You also need to account for this: cppwinrt/strings/base_includes.h Lines 27 to 53 in ff7ab25
|
|
Of course, if we can fix base_macros.h to not define a feature macro and then update the rest, as Koby originally did, to rely only on those feature macros that would save introducing yet another macro. |
bfe7f8b to
c2f577d
Compare
c2f577d to
fe92bad
Compare
|
/azp run |
|
No pipelines are associated with this pull request. |
|
@kennykerr Any additional comments? |
|
That looks great - I've spun a build. If all looks good I'll merge this in - thanks! |
kennykerr
left a comment
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.
Looks great - thanks Koby!
Fixes #764.