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 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
/awaitcommand 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++latestcommand 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/awaitin VS 16.8 and newer, or provide a way to opt-out from this behavior.