libcoro
1.0
Coroutine support library for C++20
|
Carries reference to future<T>, callable, sets value of an associated future<T> More...
Classes | |
class | notify |
contain notification to be delivered to the asociated future More... | |
Public Types | |
using | FutureType = future< T > |
Associated future. More... | |
Public Member Functions | |
promise ()=default | |
construct unbound promise More... | |
promise (FutureType *ptr) | |
Bound promise to future. More... | |
promise (promise &&other) | |
Move. More... | |
template<bool x> | |
promise (promise< T, x > &&other) | |
Move change MT Safety. More... | |
promise & | operator= (promise &&other) |
Assign by move. More... | |
~promise () | |
Dtor - if future is pending, cancels it. More... | |
notify | cancel () |
cancel the future (resolve without value) More... | |
template<typename ... Args> | |
notify | operator() (Args &&... args) |
set value More... | |
notify | reject (std::exception_ptr e) |
reject the future with exception More... | |
notify | reject () |
reject or cancel the future with exception More... | |
template<typename E > | |
notify | reject (E &&exception) |
Reject with exception. More... | |
FutureType * | release () |
Release the future pointer from the promise object. More... | |
const FutureType * | get_future () const |
Retrieve pointer to an associated future. More... | |
template<bool f> | |
promise & | operator+= (promise< T, f > &other) |
Combine two promises into one. More... | |
template<bool f> | |
promise | operator+ (promise< T, f > &other) |
Combine two promises into one. More... | |
Carries reference to future<T>, callable, sets value of an associated future<T>
T | contains type of associated future and the same type to be constructed. |
atomic | set true to make promise atomic - it can be accessed from multiple threads at same time. Default value is false, so promise is not atomic (however it is faster to handle). You can change this flag anytime, |