Share via


promise Class

Describes an asynchronous provider.

template<class Ty>
class promise;

Members

Public Constructors

Name

Description

promise::promise Constructor

Constructs a promise object.

Public Methods

Name

Description

promise::get_future Method

Returns a future associated with this promise.

promise::set_exception Method

Atomically sets the result of this promise to indicate an exception.

promise::set_exception_at_thread_exit Method

Atomically sets the result of this promise to indicate an exception, and delivers the notification only after all thread-local objects in the current thread have been destroyed (usually at thread exit).

promise::set_value Method

Atomically sets the result of this promise to indicate a value.

promise::set_value_at_thread_exit Method

Atomically sets the result of this promise to indicate a value, and delivers the notification only after all thread-local objects in the current thread have been destroyed (usually at thread exit).

promise::swap Method

Exchanges the associated asynchronous state of this promise with that of a specified promise object.

Public Operators

Name

Description

promise::operator= Operator

Assignment of the shared state of this promise object.

Inheritance Hierarchy

promise

Requirements

Header: future

Namespace: std

See Also

Other Resources

C++ Standard Library Header Files