Promise wrapping std::promise<T>. More...
#include <promise.h>
Public Member Functions | |
| Promise ()=default | |
| Constructs a Promise. | |
| ~Promise ()=default | |
| Destructor. | |
| Promise (const Promise &)=delete | |
| Promise & | operator= (const Promise &)=delete |
| Promise (Promise &&other)=default | |
| Move constructor. | |
| Promise & | operator= (Promise &&other)=default |
| Move assignment. | |
| void | setValue (T value) |
| Sets the result value. | |
| void | setError (Error error) |
| Sets an error on the promise. | |
| Future< T > | future () |
| Returns the Future associated with this Promise. | |
Promise wrapping std::promise<T>.
Used to set a result that will be retrieved via the associated Future<T>. Move-only (non-copyable).
| T | The result type. |
Sets an error on the promise.
The associated Future will receive a default-constructed T. The error is communicated via an exception internally.
| error | The error to set. |
Sets the result value.
| value | The value to make available to the Future. |