std::experimental::future(3)
π NAME π
okay so this is the std::experimental::future(3) page, from the C++ Standard Libary manual (yes bestie, βLibary,β we are keeping the header spelling exactly π). The NAME situation is std::experimental::future β std::experimental::future, and honestly? main character energy. The star of the show is literally std::experimental::future.
π Synopsis π
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. none. zero. the two do not talk π.
π§© Member functions π§©
constructorβ construct afutureobject (public member function)is_readyβ checks if the shared state is ready (public member function)thenβ attaches a continuation to afuture(public member function)operator=β moves thefutureobject (public member function)
πͺ Members identical to std::future πͺ
Note that share() returns a std::experimental::shared_future<T>. The behavior is otherwise identical.
π Member functions π
destructorβ destructs thefutureobject (public member function ofstd::future<T>)shareβ transfers the shared state from*thisto ashared_futureand returns it (public member function ofstd::future<T>)
π¬ Getting the result π¬
getβ returns the result (public member function ofstd::future<T>)
π‘οΈ State π‘οΈ
validβ checks if the future has a shared state (public member function ofstd::future<T>)waitβ waits for the result to become available (public member function ofstd::future<T>)wait_forβ waits for the result, returns if it is not available for the specified timeout duration (public member function ofstd::future<T>)wait_untilβ waits for the result, returns if it is not available until specified time point has been reached (public member function ofstd::future<T>)
π Example π
This section is incomplete.
Reason: no example.
bestie the example section is literally empty. itβs giving βweβll circle backβ π. do not invent one, we are respecting the page.
π See also π
shared_future(concurrency TS) β a version ofstd::shared_futureenhanced with continuations and other features (class template)
π·οΈ Category π·οΈ
Todo no example
mwah π thatβs the whole page. source/version + date, for the record: http://cppreference.com, 2024.06.10, and itβs the std::experimental::future(3) page. periodt.
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms