determines if a callable is a static task
A static task is a callable object that takes no arguments and returns void. It is constructible from std::function<void()>.
- Requirements
- Must be invocable with no arguments
- Must return void
- Examples
auto static_task1 = []() {};
int x = 10;
auto static_task2 = [x]() { std::cout << x << '\n'; };
static_assert(StaticTaskLike<decltype(static_task2)>);
struct SimpleTask {
void operator()() const { std::cout << "task\n"; }
};
static_assert(StaticTaskLike<SimpleTask>);
void my_task() { std::cout << "free function task\n"; }
static_assert(StaticTaskLike<decltype(&my_task)>);
auto task = taskflow.
emplace(static_task1).
name(
"static");
Task emplace(C &&callable)
creates a static task
Definition flow_builder.hpp:1562
const std::string & name() const
queries the name of the task
Definition task.hpp:1388
class to create a taskflow object
Definition taskflow.hpp:64
- Invalid Examples
auto task_with_param = [](int a) { std::cout << a << '\n'; };
auto task_returns_int = []() { return 42; };