diff --git a/doxygen/releases/release-4.1.0.dox b/doxygen/releases/release-4.1.0.dox index 0ebd7db50..6e7323dc7 100644 --- a/doxygen/releases/release-4.1.0.dox +++ b/doxygen/releases/release-4.1.0.dox @@ -59,6 +59,7 @@ If your project does not support C++20, please use %Taskflow v3.11.0, which can + refactored the codebase with C++20 concept to enhance readability + credit goest to the amazing Anthropic Claude + introduced a new profiler to replace the existing [tfprof](https://github.com/taskflow/tfprof) ++ removed extra copy on dependency tasks when creating a dependent-async task @subsection release-4-1-0_utilities Utilities diff --git a/taskflow/core/async.hpp b/taskflow/core/async.hpp index af1606539..fab729866 100644 --- a/taskflow/core/async.hpp +++ b/taskflow/core/async.hpp @@ -33,7 +33,13 @@ AsyncTask Executor::_schedule_dependent_async_task(I first, I last, size_t num_p AsyncTask task(animate(std::forward(args)...)); for(; first != last; first++) { - _process_dependent_async(task._node, *first, num_predecessors); + auto&& x = *first; + + if constexpr (std::is_pointer_v>) { + _process_dependent_async(task._node, *x, num_predecessors); + } else { + _process_dependent_async(task._node, x, num_predecessors); + } } if(num_predecessors == 0) { @@ -208,7 +214,7 @@ requires (std::same_as, AsyncTask> && ...) tf::AsyncTask Executor::silent_dependent_async( P&& params, F&& func, Tasks&&... tasks ){ - std::array array = { std::forward(tasks)... }; + std::array array{ (&tasks)... }; return silent_dependent_async( std::forward

(params), std::forward(func), array.begin(), array.end() ); @@ -261,7 +267,7 @@ auto Executor::dependent_async(F&& func, Tasks&&... tasks) { template requires (std::same_as, AsyncTask> && ...) auto Executor::dependent_async(P&& params, F&& func, Tasks&&... tasks) { - std::array array = { std::forward(tasks)... }; + std::array array{ (&tasks)... }; return dependent_async( std::forward

(params), std::forward(func), array.begin(), array.end() );