diff --git a/Modules/Core/Common/include/itkThreadPool.h b/Modules/Core/Common/include/itkThreadPool.h index 821fbd257d86..e2b8f12dc873 100644 --- a/Modules/Core/Common/include/itkThreadPool.h +++ b/Modules/Core/Common/include/itkThreadPool.h @@ -89,7 +89,7 @@ auto result = pool->AddWork([](int param) { return param; }, 7); using return_type = std::invoke_result_t; auto task = std::make_shared>( - std::bind(std::forward(function), std::forward(arguments)...)); + [function = std::forward(function), arguments...]() -> return_type { return function(arguments...); }); std::future res = task->get_future(); {