Find Related products on Amazon

Shop on Amazon

Investigating an argument-dependent lookup issue and working around it

Published on: 2025-06-23 19:03:51

C++/WinRT pull request 1225 fixed a problem with a call to invoke . What’s the problem, why did it show up all of a sudden, and what can you do if you are stuck on an older version of C++/WinRT? The problem is at the point in winrt:: impl:: promise_base ::set_completed makes an unqualified call to invoke() : namespace winrt::impl { ⟦ ... ⟧ template bool invoke(Delegate const& delegate, Arg const&... args) noexcept; ⟦ ... ⟧ template struct promise_base : implements { ⟦ ... ⟧ void set_completed() noexcept { async_completed_handler_t handler; AsyncStatus status; ⟦ ... ⟧ if (handler) { invoke(handler, *this, status); } } } } The call to invoke intends to resolve to winrt:: impl:: invoke but instead, it resolves to std:: invoke . Why? Argument-dependent lookup. If you make a function call through an unquali ... Read full article.