future Class

Describes an asynchronous return object.

template<class Ty>
class future;

Remarks

Each standard asynchronous provider returns an object whose type is an instantiation of this template. A future object provides the only access to the asynchronous provider that it is associated with. If you need multiple asynchronous return objects that are associated with the same asynchronous provider, copy the future object to a shared_future object.

Members

Public Constructors

Name

Description

future::future Constructor

Constructs a future object.

Public Methods

Name

Description

future::get Method

Retrieves the result that is stored in the associated asynchronous state.

future::share Method

Converts the object to a shared_future.

future::valid Method

Specifies whether the object is not empty.

future::wait Method

Blocks the current thread until the associated asynchronous state is ready.

future::wait_for Method

Blocks until the associated asynchronous state is ready or until the specified time has elapsed.

future::wait_until Method

Blocks until the associated asynchronous state is ready or until a specified point in time.

Public Operators

Name

Description

future::operator= Operator

Transfers the associated asynchronous state from a specified object.

Requirements

Header: future

Namespace: std

See Also

Reference

<future>

Other Resources

Header Files