Visitar URL original
Template-ify Task and Taskflow for type-erasure backend · Issue #744 · taskflow/taskflow · GitHub
Skip to content

Template-ify Task and Taskflow for type-erasure backend #744

Open

Description

@doocman

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.

Activity

  1. tsung-wei-huang commented on Dec 15, 2025

    @tsung-wei-huang
    Member

    Hi @doocman , this in fact is a very good idea although it requires templating pretty much everything in the library (requiring a big rewrite). If you would like to help contribute to this effort, please let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions