std::experimental::future
From cppreference.com
< cpp | experimental
C++
Experimental
| Technical Specification | ||||
| Filesystem library (filesystem TS) | ||||
| Library fundamentals (library fundamentals TS) | ||||
| Library fundamentals 2 (library fundamentals TS v2) | ||||
| Library fundamentals 3 (library fundamentals TS v3) | ||||
| Extensions for parallelism (parallelism TS) | ||||
| Extensions for parallelism 2 (parallelism TS v2) | ||||
| Extensions for concurrency (concurrency TS) | ||||
| Extensions for concurrency 2 (concurrency TS v2) | ||||
| Concepts (concepts TS) | ||||
| Ranges (ranges TS) | ||||
| Reflection (reflection TS) | ||||
| Mathematical special functions (special functions TR) | ||||
| Experimental Non-TS | ||||
| Pattern Matching | ||||
| Linear Algebra | ||||
| std::execution | ||||
| Contracts | ||||
| 2D Graphics |
Extensions for concurrency
| std::future extensions | ||||
experimental::future | ||||
| Latches and barriers | ||||
| Atomic smart pointers | ||||
std::experimental::future
| Defined in header <experimental/future>
|
||
| template< class T > class future; |
(1) | (concurrency TS) |
| template< class T > class future<T&>; |
(2) | (concurrency TS) |
| template<> class future<void>; |
(3) | (concurrency TS) |
The class template std::experimental::future extends std::future with the following operations:
- an unwrapping constructor from
future<future<T>>; - a member function
is_readyto query whether the associated shared state is ready; and - a member function
thento attach a continuation to the future.
However, there is no interoperation between std::experimental::future and std::future.
Contents |
[edit] Member functions
construct a future object (public member function) [edit] | |
| checks if the shared state is ready (public member function) [edit] | |
| attaches a continuation to a future (public member function) [edit] | |
| moves the future object (public member function) [edit] |
Members identical to std::future
Member functions
Note that share() returns a std::experimental::shared_future<T>. The behavior is otherwise identical.
| destructs the future object (public member function of std::future<T>) [edit]
| |
| transfers the shared state from *this to a shared_future and returns it (public member function of std::future<T>) [edit]
| |
Getting the result | |
| returns the result (public member function of std::future<T>) [edit]
| |
State | |
| checks if the future has a shared state (public member function of std::future<T>) [edit]
| |
| waits for the result to become available (public member function of std::future<T>) [edit]
| |
| waits for the result, returns if it is not available for the specified timeout duration (public member function of std::future<T>) [edit]
| |
| waits for the result, returns if it is not available until specified time point has been reached (public member function of std::future<T>) [edit]
| |
[edit] Example
| This section is incomplete Reason: no example |
[edit] See also
| (concurrency TS) |
a version of std::shared_future enhanced with continuations and other features (class template) [edit] |