diff --git a/src/lib/thread.hpp b/src/lib/thread.hpp index 383bd9d54..11a664d86 100644 --- a/src/lib/thread.hpp +++ b/src/lib/thread.hpp @@ -134,8 +134,8 @@ namespace lib { using std::decay_t; using std::invoke_result_t; using std::is_constructible; - using std::index_sequence_for; - using std::index_sequence; + using std::make_from_tuple; + using std::tuple_cat; using std::is_same; using std::__or_; @@ -344,28 +344,21 @@ namespace lib { - template - static auto - buildLauncher_impl (tuple&& argCopy, index_sequence) - { - return [invocation = move(argCopy)] - (ThreadLifecycle& wrapper) - { - ASSERT (not wrapper.isLive()); - wrapper.threadImpl_ - = std::thread{&ThreadLifecycle::invokeThreadFunction - , &wrapper - , move(std::get (invocation))... }; - }; - } - template static auto buildLauncher (INVO&& ...args) { // materialise functor and arguments as copy, to be handed over into the new thread - return buildLauncher_impl (tuple...>{forward (args)...} - ,index_sequence_for{}); + tuple...> argCopy{forward (args)...}; + return [invocation = move(argCopy)] + (ThreadLifecycle& wrapper) + { + auto threadArgs = tuple_cat (tuple{&ThreadLifecycle::invokeThreadFunction, &wrapper} + ,move (invocation)); + ASSERT (not wrapper.isLive()); + wrapper.threadImpl_ + = make_from_tuple (threadArgs); + }; } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 0ee17066d..a2ffe3593 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -65803,6 +65803,10 @@ + + + +