Share via

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?

Community Center | Not monitored
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.