diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-14 12:29:24 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-14 12:29:24 +0100 |
commit | e671adba5a57e1d4e848eb4d6de0f480e7b3709a (patch) | |
tree | cb4e9009379ba3b48a8606fada5006a959063dee /lib/worker.h | |
parent | New WorkItem/job/promise/future based interface (diff) | |
download | ilt-e671adba5a57e1d4e848eb4d6de0f480e7b3709a.tar.bz2 ilt-e671adba5a57e1d4e848eb4d6de0f480e7b3709a.tar.xz ilt-e671adba5a57e1d4e848eb4d6de0f480e7b3709a.zip |
Simplify doWork, add tests for various interface uses
Diffstat (limited to 'lib/worker.h')
-rw-r--r-- | lib/worker.h | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/worker.h b/lib/worker.h index 5356606..1bc7c14 100644 --- a/lib/worker.h +++ b/lib/worker.h @@ -56,19 +56,11 @@ private: { try { if constexpr (std::is_void_v<T>) { - std::apply( - [](auto &&... p) { - return std::invoke(p...); - }, - params); + std::apply(std::invoke<Params &...>, params); WorkItemT<T>::promise.set_value(); } else { - WorkItemT<T>::promise.set_value(std::apply( - [](auto &&... p) { - return std::invoke(p...); - }, - params)); + WorkItemT<T>::promise.set_value(std::apply(std::invoke<Params &...>, params)); } } catch (...) { |