다음을 통해 공유


shared_future 클래스

Describes an asynchronous return object. In contrast with a future object, an asynchronous provider can be associated with any number of shared_future objects.

template<class Ty>
class shared_future;

설명

Do not call any methods other than valid, operator=, and the destructor on a shared_future object that's empty.

shared_future objects are not synchronized. Calling methods on the same object from multiple threads introduces a data race that has unpredictable results.

멤버

Public 생성자

Name

설명

shared_future::shared_future 생성자

shared_future 개체를 생성합니다.

Public 메서드

Name

설명

shared_future::get 메서드

Retrieves the result that's stored in the associated asynchronous state.

shared_future::valid 메서드

Specifies whether the object is not empty.

shared_future::wait 메서드

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

shared_future::wait_for 메서드

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

shared_future::wait_until 메서드

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

Public 연산자

Name

설명

shared_future::operator= 연산자

Assigns a new associated asynchronous state.

요구 사항

헤더: future

네임스페이스: std

참고 항목

참조

<future>

기타 리소스

C++ 표준 라이브러리 헤더 파일