LambdaTask class
A Task that runs a stored callable.
On this page
- Use
import ThinkMeta.ConcurrentTasks.Tasks.Task;- Namespace
ThinkMeta::ConcurrentTasks::Tasks- Inherits
Task- Platforms
- Windows, Linux
Syntax
template <std::invocable F> class LambdaTask final : public TaskTemplate parameters
Fstd::invocable- Type of the stored callable: an object type invocable without arguments; it must not throw.
Remarks
Run calls the stored callable of type F. Usually built by Task::Create. The callable must not throw: an exception escaping it ends the process.
Constructors
LambdaTask
Stores the callable.
Syntax
template <typename FF>
requires std::constructible_from<F, FF&&>
explicit LambdaTask(
FF&& func,
INotifyTaskStateChange* notifyTaskStateChange = nullptr
) noexcept;Template parameters
FFtypename- Type of the argument;
Fmust be constructible from it.
Parameters
funcFF&&- Copied or moved into
F. notifyTaskStateChangeINotifyTaskStateChange*- Told when the task exits; may be
nullptr.Default:nullptr
Methods
Run
Calls the stored callable.
Syntax
void Run() noexcept override;Remarks
The task may be run again after Task::OnTaskExited.
Generated from ThinkMeta.ConcurrentTasks.API @ c7663c4 (2026-11-19).