Commit bcb39362 authored by Shen-Ta Hsieh's avatar Shen-Ta Hsieh Committed by Max Kellermann

win32/ComWorker: rename variable name to prevent ambiguous

parent 18d3a5c1
...@@ -52,17 +52,17 @@ public: ...@@ -52,17 +52,17 @@ public:
using R = std::invoke_result_t<std::decay_t<Function>>; using R = std::invoke_result_t<std::decay_t<Function>>;
auto promise = std::make_shared<Promise<R>>(); auto promise = std::make_shared<Promise<R>>();
auto future = promise->get_future(); auto future = promise->get_future();
Push([function = std::forward<Function>(function), Push([func = std::forward<Function>(function),
promise = std::move(promise)]() mutable { prom = std::move(promise)]() mutable {
try { try {
if constexpr (std::is_void_v<R>) { if constexpr (std::is_void_v<R>) {
std::invoke(std::forward<Function>(function)); std::invoke(std::forward<Function>(func));
promise->set_value(); prom->set_value();
} else { } else {
promise->set_value(std::invoke(std::forward<Function>(function))); prom->set_value(std::invoke(std::forward<Function>(func)));
} }
} catch (...) { } catch (...) {
promise->set_exception(std::current_exception()); prom->set_exception(std::current_exception());
} }
}); });
return future; return future;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment