Specialization of promise for void type. The promise<void> does not store a value, but only the state of readiness and any exception.
More...
#include <coopsync_tbb/future.hpp>
|
|
| promise ()=default |
| | Constructs a new promise with an empty shared state.
|
| template<typename Alloc> |
| | promise (const Alloc &alloc) |
| | Constructs a new promise using the given allocator.
|
|
| promise (const promise &)=delete |
| | The promise is not copy-constructible.
|
|
promise & | operator= (const promise &)=delete |
| | The promise is not copy-assignable.
|
| | promise (promise &&other) noexcept=default |
| | The promise is move-constructible.
|
| promise & | operator= (promise &&other) noexcept=default |
| | The promise is move-assignable.
|
|
| ~promise ()=default |
| | Destroys the promise. If the shared state is not ready, it is marked as broken.
|
| void | swap (promise &other) noexcept |
| | Exchanges the shared states between two promises.
|
| future< void > | get_future () |
| | Returns a future associated with the shared state.
|
| void | set_value () |
| | Marks the shared state as ready without storing a value.
|
| void | set_exception (std::exception_ptr p) |
| | Stores an exception into the shared state and makes it ready.
|
Specialization of promise for void type. The promise<void> does not store a value, but only the state of readiness and any exception.
◆ promise() [1/2]
Constructs a new promise using the given allocator.
- Parameters
-
| alloc | Allocator used to allocate the shared state. |
◆ promise() [2/2]
The promise is move-constructible.
- Parameters
-
| other | The promise to move from, after construction has empty shared state. |
◆ get_future()
Returns a future associated with the shared state.
- Exceptions
-
| future_error | with std::future_errc::no_state if the promise is not valid. |
| future_error | with std::future_errc::future_already_retrieved if the future was already retrieved. |
◆ operator=()
The promise is move-assignable.
- Parameters
-
| other | The promise to move from, after assignment has empty shared state. |
◆ set_exception()
Stores an exception into the shared state and makes it ready.
- Parameters
-
| p | The exception to store in the shared state. |
- Exceptions
-
| future_error | with std::future_errc::no_state if the promise is not valid. |
◆ set_value()
Marks the shared state as ready without storing a value.
- Exceptions
-
| future_error | with std::future_errc::no_state if the promise is not valid. |
| future_error | with std::future_errc::promise_already_satisfied if the shared state already stores a value or an exception. |
◆ swap()
Exchanges the shared states between two promises.
- Parameters
-
| other | The promise to exchange shared state with. |
The documentation for this class was generated from the following file: