stlab::task is a general-purpose polymorphic function wrapper. Instances of
stlab::task can store, move, and invoke any Callable target – functions, lambda expressions, bind expressions, or other function objects, as well as pointers to member functions and pointers to data members.
The stored callable object is called the target of
stlab::task. If an
stlab::task contains no target, it is called empty. Invoking the target of an empty
stlab::task results in
std::bad_function_call exception being thrown.
stlab::task is Similar to
std::function except it is not copyable and supports move-only and mutable callable targets which is especially useful for targets that may only be invoked once, often useful to deliver a message or payload in tasking or messaging system.