diff --git a/src/common/utils.h b/src/common/utils.h index 9ac1e12c..b7f8a0bf 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -45,6 +45,17 @@ constexpr char product_name_override[] = "Get yabridge'd"; */ constexpr char vendor_name_override[] = "yabridge"; +/** + * The same as the `std::invocable` concept, but also specifying the result + * type. + */ +template +concept invocable_returning = requires(F&& f, Result&& result, Args&&... args) { + { + std::invoke(std::forward(f), std::forward(args)...) + } -> std::convertible_to; +}; + // The cannonical overloading template for `std::visitor`, not sure why this // isn't part of the standard library template diff --git a/src/wine-host/utils.h b/src/wine-host/utils.h index 95ea561f..510a57ea 100644 --- a/src/wine-host/utils.h +++ b/src/wine-host/utils.h @@ -277,7 +277,7 @@ class MainContext { * that will cause them to stall indefinitely in this situation, but who * knows which other plugins exert similar behaviour. */ - template + template P> void async_handle_events(F handler, P predicate) { // Try to keep a steady framerate, but add in delays to let other events // get handled if the GUI message handling somehow takes very long.