libcoro  1.0
Coroutine support library for C++20

◆ forward_to() [2/2]

template<typename T >
template<typename X >
promise<X>::notify coro::future< T >::forward_to ( promise< X > &  prom) &
inlinenoexcept

Forward value, possibly convert it, to different promise.

The source future must be resolved. The function forwards whole state without throwing any exception. So the target promise recives possible exception or cancel status

Parameters
promtarget promise
Returns
notify of target promise. If the future is not resulved, return is false
Note
uses copying. If you need move, you need to use std::move(x.forward_to(...))

Definition at line 822 of file future.h.