Can you co_await in a C++/WinRT TimerElapsedHandler (or any other lambda in C++/WinRT)?
When I try to compile code like this:
auto pointerExitedTimerHandler = winrt::TimerElapsedHandler([](const winrt::ThreadPoolTimer&)
{
co_await 5s;
// Other stuff...
});
I get an error:
error C7588: A definition of a class template std::experimental::task must be provided for the return type of this coroutine to be deduced
How can I write an async handler?
Disclaimer: I work for Microsoft.