std::packag...:get_future(3)
π NAME
std::packaged_task::get_future β ok so this is literally the std::packaged_task::get_future page, bestie, coming at you straight from the C++ Standard Libary manual π¦
β¨ Synopsis
Here's the whole vibe, one line, no cap:
std::future<R> get_future(); (since C++11)
So what does it actually do? It returns a future which shares the same shared state as *this π«Ά That's it. That's the whole personality.
β οΈ But bestie listen βget_futurecan be called only once for eachpackaged_task. Not twice. Not "oops let me try again." Once. Periodt. π
π Parameters
(none) β she takes nothing! No arguments, no drama, iconic behavior honestly πΈ
πΈ Return value
A future which shares the same shared state as *this β¨ (yes, same sentence as the synopsis β cppreference said it twice so we're saying it twice, consistency queen π)
π Exceptions
If things go sideways, you get a std::future_error on the following error conditions:
- The shared state has already been retrieved via a call to
get_future. The error category is set tofuture_already_retrieved. π (you already asked, girl, she's not gonna give it twice) *thishas no shared state. The error category is set tono_state. π (there's literally nothing there to share β vibe check failed)
anyway that's the whole page, mwah π shoutout to http://cppreference.com for hosting this, dated 2024.06.10 β go drink some water and go call get_future exactly once, iykyk π§ββοΈπ«Ά
π¦ 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