Template-ify Task and Taskflow for type-erasure backend
#744 aperta il 11 dic 2025
Metriche repository
- Star
- (9162 stelle)
- Metriche merge PR
- (Merge medio 35g 4h) (1 PR mergiata in 30 g)
Descrizione
Today Taskflow and Task:s uses std::function<...> unconditionally for all type-erasing operations. Sometimes, however, a user may need to use their own type-erasure, or there are circumstances that make the standard function suboptimal (I have also seen an issue regarding using 'delegate' instead, which also aligns with this request).
I am proposing that we follow the 'standard' (STL) style and create
template </*something function*/> BasicTask
and
template </*something function*/> BasicTaskflow
(similar to std::basic_string) and replace current Task and Taskflow with type-aliases:
using Task = BasicTask<std::function<void()>>;
and similar for Taskflow. This should be fully backwards compatible and doable since Taskflow is a header-only library anyway.