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

Guanghui Li 0 Reputation points

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.
35,014 questions
{count} votes