A lightweight version of std::promise.
More...
#include <wpi/future.h>
template<typename T>
class wpi::promise< T >
A lightweight version of std::promise.
Use PromiseFactory::CreatePromise() to create.
- Template Parameters
-
◆ promise() [1/3]
Constructs an empty promise.
◆ promise() [2/3]
◆ promise() [3/3]
◆ ~promise()
Sets the promised value to a default-constructed T if not already set.
◆ get_future()
Gets a future for this promise.
- Returns
- The future
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ set_value() [1/2]
Sets the promised value.
Only effective once (subsequent calls will be ignored).
- Parameters
-
value | The value to provide to the waiting future |
◆ set_value() [2/2]
Sets the promised value.
Only effective once (subsequent calls will be ignored).
- Parameters
-
value | The value to provide to the waiting future |
◆ swap()
Swaps this promise with another one.
◆ PromiseFactory< T >
The documentation for this class was generated from the following file: