libcoro  1.0
Coroutine support library for C++20

◆ operator+()

template<typename T , bool atomic>
template<bool f>
promise coro::promise< T, atomic >::operator+ ( promise< T, f > &  other)
inline

Combine two promises into one.

Two promises are combined into one and they can be fulfilled together by single call operation. Requires T copy constructible. There is no reverse operation

Parameters
otherother promise which is attached
Returns
new promise contains combined promises. Previous objects are left empty
Note
result is current promise controls also attached promise. You can combine unlimited count of promises into one.
order of processing of such promise is not defined - can be random.

Definition at line 329 of file future.h.