Namespaces
Variants

std::coroutine_handle<Promise>:: from_promise

From cppreference.net
Utilities library
Coroutine support
Coroutine traits
Coroutine handle
No-op coroutines
Trivial awaitables
Range generators
(C++23)
static coroutine_handle from_promise ( Promise & p ) ;
(C++20부터)

코루틴의 promise 객체로부터 coroutine_handle 를 생성합니다. 생성된 coroutine_handle 는 해당 코루틴을 참조하며, promise() p 에 대한 참조를 반환합니다.

p 가 promise 객체에 대한 참조가 아닌 경우 동작은 정의되지 않습니다. 이 함수는 기본 템플릿에 대해서만 제공되며, 즉 특수화된 std:: coroutine_handle <> std:: coroutine_handle < std:: noop_coroutine_promise > 는 이 함수를 가지고 있지 않습니다.

목차

매개변수

p - 코루틴이 참조할 promise 객체

반환값

주어진 코루틴을 참조하는 coroutine_handle 입니다.

예제

참고 항목

coroutine_handle 객체를 생성합니다
(public member function)
포인터로부터 코루틴을 가져옵니다
(public static member function)
재개되거나 파괴될 때 관찰 가능한 효과가 없는 코루틴 핸들을 생성합니다
(function)