For a subexpression c,
let GET-AWAITER(c, p) be expression-equivalent to
the series of transformations and conversions applied to c
as the operand of an await-expression in a coroutine,
resulting in lvalue e as described by [expr.await],
where p is an lvalue referring to the coroutine's promise,
which has type Promise.
This includes the invocation of
the promise type's await_transform member if any,
the invocation of the operatorco_await
picked by overload resolution if any, and
any necessary implicit conversions and materializations.
Let is-awaitable be the following exposition-only concept:
namespace std {template<class T>conceptawait-suspend-result=see below; // exposition onlytemplate<class A, class Promise>conceptis-awaiter=// exposition onlyrequires(A& a, coroutine_handle<Promise> h){
a.await_ready()?1:0;
{ a.await_suspend(h)}->await-suspend-result;
a.await_resume();
};
template<class C, class Promise>conceptis-awaitable=// exposition onlyrequires(C (*fc)()noexcept, Promise& p){{GET-AWAITER(fc(), p)}->is-awaiter<Promise>;
};
}
For a subexpression c
such that decltype((c)) is type C, and
an lvalue p of type Promise,
await-result- type<C, Promise> denotes
the type decltype(GET-AWAITER(c, p).await_resume()).