What is the difference and gap between IAsyncAction and C++20 awaitable?

Guanghui Li 0 Reputation points
2024-01-23T07:05:50.5266667+00:00

I'm developing a WindowsAppSDK application using C++/WinRT. At the same time, I'm using some boost ASIO libraries using C++ 20 coroutine codes. But the compiler reports error when I tried using like:

winrt::Windows::Foundation::IAsyncAction foo() {
    co_await boost::asio::this_coro::executor;
    ...
}

It seems I couldn't use C++20 coroutine in C++/WinRT IAsyncAction fuctions. Could anyone help me to understand this conflict?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,794 questions
{count} votes