From: Daniel Arndt Date: Sun, 6 Oct 2019 15:48:09 +0000 (-0400) Subject: Remove some uses of std::bind from thread_management.h X-Git-Tag: v9.2.0-rc1~993^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f7a49c35a68f7b693f012c08f478043bdb3a35c;p=dealii.git Remove some uses of std::bind from thread_management.h --- diff --git a/include/deal.II/base/thread_management.h b/include/deal.II/base/thread_management.h index 35f06ed17a..b482f7fd9b 100644 --- a/include/deal.II/base/thread_management.h +++ b/include/deal.II/base/thread_management.h @@ -21,6 +21,7 @@ # include # include +# include # include # include @@ -1096,8 +1097,9 @@ namespace Threads inline Thread new_thread(RT (*fun_ptr)(Args...), typename identity::type... args) { - return new_thread(std::function( - std::bind(fun_ptr, internal::maybe_make_ref::act(args)...))); + auto dummy = std::make_tuple(internal::maybe_make_ref::act(args)...); + return new_thread( + [dummy, fun_ptr]() -> RT { return std_cxx17::apply(fun_ptr, dummy); }); } @@ -1753,8 +1755,9 @@ namespace Threads inline Task new_task(RT (*fun_ptr)(Args...), typename identity::type... args) { - return new_task(std::function( - std::bind(fun_ptr, internal::maybe_make_ref::act(args)...))); + auto dummy = std::make_tuple(internal::maybe_make_ref::act(args)...); + return new_task( + [dummy, fun_ptr]() -> RT { return std_cxx17::apply(fun_ptr, dummy); }); }