From 2f7a49c35a68f7b693f012c08f478043bdb3a35c Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sun, 6 Oct 2019 11:48:09 -0400 Subject: [PATCH] Remove some uses of std::bind from thread_management.h --- include/deal.II/base/thread_management.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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); }); } -- 2.39.5