-
Notifications
You must be signed in to change notification settings - Fork 239
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
Implement upcoming STL C++20 coroutines support #676
Comments
Yes, it might soon be time to create a C++17 branch for servicing and then switch master over to C++20. I'd like to avoid supporting both C++17 and C++20 as it can become quite complex especially since Clang and Visual C++ are never quite in line. |
It looks like you're saying VC++ in C++17 mode does not define |
Yes (although it might be better to use |
Looks like |
Now VS 16.8 Preview 3.0 is out with "full C++20 coroutines support". |
I've been away for a few weeks but should be back in the "office" next week and plan to take a look at 16.8 support. |
Subscribed to this issue because I'm also blocked by it |
The C++/WinRT library has been updated to support both C++17 and C++20 coroutines. |
Can confirm that I'm now un-blocked. Thank you so much! |
Hi @kennykerr, I was just trying to build my C++/WinRT header (which I have created using
Which will try to include My |
That cppwinrt version is super old, it seems to be from around February 2020. Try the NuGet for an up to date version. |
Oh well.. Shame on me 😓 I just installed it yesterday via a Nuget package but somehow I have managed to install an old version.. Tried it with the news version of cppwinrt.exe and what do you know, no compile errors anymore 🚀 Thanks for the quick response! |
The Microsoft STL has recently merged non-experimental coroutine support: microsoft/STL#894
This support, once shipped (expected around 16.8 preview 1), will prevent mixing code using the new coroutines and the experimental ones.
Using the
/await
command line (which is forced in various places by the C++/WinRT project files) will prevent including<coroutine>
, telling you to use<experimental/coroutine>
. Similarly, using the/std:c++latest
command line (my code makes use of many new C++ 20 only features), will prevent including<experimental/coroutine>
, telling you to instead use<coroutine>
.This puts me in a weird spot: I can't include
<coroutine>
because C++/WinRT uses<experimental/coroutine>
and/await
, but neither can I include<experimental/coroutine>
because I use/std:c++latest
.Ideally, the C++/WinRT headers should detect the presence of C++20 coroutines (using
__cpp_impl_coroutine
) and use the right header. Additionally, the project files should not force/await
in VS 16.8 and newer, or provide a way to opt-out from this behavior.The text was updated successfully, but these errors were encountered: