Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
uni20::async::TaskAwaitable Concept Reference

Concept for awaitables that accept promise-neutral task ownership. More...

#include <async_task_promise.hpp>

Concept definition

template<typename T>
concept uni20::async::TaskAwaitable = requires(T a, BasicTask task) {
{ a.await_suspend(std::move(task)) } noexcept -> AwaitSuspendResult;
}
Concept for the valid return types of await_suspend.
Definition async_task_promise.hpp:48
Concept for awaitables that accept promise-neutral task ownership.
Definition async_task_promise.hpp:61

Detailed Description

Concept for awaitables that accept promise-neutral task ownership.

This concept is satisfied if the awaitable provides:

Note
This concept disallows await_suspend() from returning a coroutine_handle, to ensure that ownership and resumption are managed solely by the scheduler.
Suspension must not throw after accepting coroutine ownership because ownership transfer cannot be rolled back in general.