template<typename T>
nCine::Task struct

Awaitable result of an asynchronous coroutine operation.

When coroutine support is enabled, wraps a std::coroutine_handle and acts as both an awaiter and a coroutine return object yielding a value of type T, with one_step() driving the coroutine chain manually. When coroutines are unavailable, it degrades to a plain holder that is implicitly convertible to its stored T value.

Public types

struct task_promise
using promise_type = task_promise
using handle_type = std::coroutine_handle<promise_type>

Constructors, destructors, conversion operators

Task(handle_type handle)
Task(Task&& other) noexcept
~Task()

Public functions

auto await_ready() -> bool
auto await_suspend(std::coroutine_handle<> handle) -> bool
auto await_suspend(std::coroutine_handle<promise_type> handle) -> bool
auto await_resume() -> auto
auto one_step() -> bool
Advances the coroutine chain by one step.

Function documentation

template<typename T>
bool nCine::Task<T>::one_step()

Advances the coroutine chain by one step.

Returns true if the task has more work to do, false once it has finished