A type-erased future that produces a value of type T.
BoxedFuture wraps another future, storing it dynamically via a pw::Allocator. This hides the concrete type of the future, which is useful when storing or returning futures of different concrete types.
Public Types | |
| using | value_type = T |
Public Member Functions | |
| BoxedFuture () | |
Constructs an empty BoxedFuture. | |
| BoxedFuture (const BoxedFuture &)=delete | |
| BoxedFuture & | operator= (const BoxedFuture &)=delete |
| BoxedFuture (BoxedFuture &&other) noexcept | |
| BoxedFuture & | operator= (BoxedFuture &&other) noexcept |
| bool | is_pendable () const |
Returns whether Pend() can be called. | |
| bool | is_complete () const |
| Returns whether the future has completed. | |
| Poll< T > | Pend (Context &cx) |
| Advances the future. | |
Friends | |
| template<typename FutureType > | |
| BoxedFuture< typename std::decay_t< FutureType >::value_type > | BoxFuture (Allocator &alloc, FutureType &&future) |
|
friend |
Type-erases a future, wrapping it in a BoxedFuture allocated using the specified allocator.
Example: