win32/ComWorker: rename variable name to prevent ambiguous
This commit is contained in:
parent
18d3a5c12b
commit
bcb393628e
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user