Optional future base class for future implementations. Provides value_type, Pend(), and is_complete(). Requires the derived class to implement DoPend(),DoMarkComplete(), andDoIsComplete()`.
Public Types | |
| using | value_type = std::conditional_t< std::is_void_v< T >, ReadyType, T > |
Public Member Functions | |
| Poll< value_type > | Pend (Context &cx) |
| bool | is_complete () const |
|
inline |
Returns true if the future has already returned a Ready result.
Calling Pend on a completed future will trigger an assertion.
|
inline |
Polls the future to advance its state.
Returns Pending if the future is not yet complete, or Ready with its result if it is.
If this future has already completed, calling Pend will trigger an assertion.