Specialization of future for void type.
More...
#include <coopsync_tbb/future.hpp>
|
|
| future () noexcept=default |
| | Constructs a new future. After construction the future has no shared state and is not valid.
|
|
| future (const future &)=delete |
| | The future is not copy-constructible.
|
|
future & | operator= (const future &)=delete |
| | The future is not copy-assignable.
|
| | future (future &&other) noexcept=default |
| | The future is move-constructible.
|
| future & | operator= (future &&other) noexcept=default |
| | The future is move-assignable.
|
|
| ~future ()=default |
| | Destroys the future releasing any shared state.
|
| bool | valid () const noexcept |
| | Tests whether the future is valid and refers to a shared state.
|
| bool | try_wait () const |
| | Checks whether the shared state is ready without suspending.
|
| void | wait () const |
| | Suspends the current task until the shared state is ready.
|
| void | get () |
| | Waits for readiness and consumes the shared state. If the shared state is ready, this function returns immediately. Otherwise, the task is suspended until the state becomes ready. After this call the future is left in not valid state.
|
| shared_future< void > | share () |
| | Converts this future into a shared_future. After this call, the current future is left in not valid state.
|
|
|
class | promise< void > |
|
template<typename> |
| class | packaged_task |
|
class | promise< T > |
Specialization of future for void type.
◆ future()
The future is move-constructible.
- Parameters
-
| other | The future to move from, after construction has no shared state and is not valid. |
◆ get()
Waits for readiness and consumes the shared state. If the shared state is ready, this function returns immediately. Otherwise, the task is suspended until the state becomes ready. After this call the future is left in not valid state.
- Exceptions
-
| future_error | if the future is not valid, if the promise was broken, or if the value was already retrieved. |
| Any | exception stored in the shared state. |
◆ operator=()
The future is move-assignable.
- Parameters
-
| other | The future to move from, after assignment has no shared state and is not valid. |
◆ share()
Converts this future into a shared_future. After this call, the current future is left in not valid state.
- Returns
- A shared_future referring to the same shared state.
- Exceptions
-
| future_error | with std::future_errc::no_state if the future is not valid. |
◆ try_wait()
Checks whether the shared state is ready without suspending.
- Returns
- true if the shared state is ready, false otherwise.
- Exceptions
-
| future_error | with std::future_errc::no_state if the future is not valid. |
◆ valid()
Tests whether the future is valid and refers to a shared state.
- Returns
- true if the future is valid, false otherwise.
◆ wait()
Suspends the current task until the shared state is ready.
If the shared state is ready this function returns immediately.
- Exceptions
-
| future_error | with std::future_errc::no_state if the future is not valid. |
The documentation for this class was generated from the following file: