Why am I getting a weird error about promise_type when I try to write a coroutine?

2 · Raymond Chen · Aug. 9, 2021, 2:42 p.m.
A customer was following a tutorial by Kenny Kerr and tried to create the world’s simplest coroutine: using namespace winrt::Windows::Foundation; IAsyncAction Dummy() { co_return; } This resulted in an error: // MSVC error C2039: 'promise_type': is not a member of 'std::experimental::coroutine_traits<winrt::Windows::Foundation::IAsyncAction>' // gcc error: unable to find the promise type for this coroutine // clang this function cannot be a coroutine: 'std::experimental::coroutine_traits<wi...