Skip to content

Implement upcoming STL C++20 coroutines support #676

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions