std::experimental::future - cppreference.com (original) (raw)

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:

However, there is no interoperation between std::experimental::future and std::future.

Contents

[edit] Member functions

Members identical to std::future

Member functions

Note that share() returns a std::experimental::shared_future. The behavior is otherwise identical.

(destructor) destructs the future object (public member function of std::future) [edit]
share transfers the shared state from *this to a shared_future and returns it (public member function of std::future) [edit]
Getting the result
get returns the result (public member function of std::future) [edit]
State
valid checks if the future has a shared state (public member function of std::future) [edit]
wait waits for the result to become available (public member function of std::future) [edit]
wait_for waits for the result, returns if it is not available for the specified timeout duration (public member function of std::future) [edit]
wait_until waits for the result, returns if it is not available until specified time point has been reached (public member function of std::future) [edit]

[edit] Example

[edit] See also