STD::FUTURE(3)
π NAME π
std::future< _Res > β the primary template for future, bestie. It's giving "your value will be here soon, I promise, no cap."
β¨ SYNOPSIS β¨
#include <future>
Inherits std::__basic_future< _Res >. Yeah she's got a whole family tree, we love an inherited queen. π
πΈ Public Member Functions πΈ
future (const future &)=deleteβ copy constructor? Deleted. Gone. Not invited to the party. π«future (future &&__uf) noexceptβ the move constructor, aka the glow-up transfer. Everything gets yeeted from__ufinto your new future,noexceptand unbothered._Res get ()β retrieving the value, the main character moment fr.future & operator= (const future &)=deleteβ copy assignment? Also deleted. This girl does not do duplicates. πfuture & operator= (future &&__fut) noexceptβ move assignment,noexcept, iconic.shared_future< _Res > share () noexceptβ turn your exclusive lil future into ashared_future< _Res >,noexcept. Sharing is caring π«Άbool valid () const noexceptβ is this future actually holding a shared state?constandnoexcept, a well-behaved angel.void wait () constβ just sit here and wait,const, no take-backs.template<typename _Rep, typename _Period> future_status wait_for (const chrono::duration< _Rep, _Period > &__rel) constβ wait for a relative duration, returns afuture_status. Patience but make it timed β³template<typename _Clock, typename _Duration> future_status wait_until (const chrono::time_point< _Clock, _Duration > &__abs) constβ wait until an absolutechrono::time_point< _Clock, _Duration >. Deadline queen energy β
π Protected Types π
typedef __future_base::_Result< _Res > & __result_typeβ yes, it's a reference, don't @ me.
π¦ Protected Member Functions π¦
__result_type _M_get_result () constβ wait for the state to be ready and rethrow any stored exception. It's the backstage crew making the whole show happen.void _M_swap (__basic_future &__that) noexceptβ swap the goods with__that,noexcept.
π Friends π
template<typename _Fn, typename... _Args> future< __async_result_of< _Fn, _Args... > > async (launch, _Fn &&, _Args &&...)template<typename> class packaged_taskclass promise< _Res >
Not gonna lie, these three are the inner circle. iykyk.
π₯ Detailed Description π₯
template<typename _Res>
class std::future< _Res >
"Primary template for future." That's literally the official vibe. π
π Constructor & Destructor Documentation π
template<typename _Res>
std::future< _Res >::future (future< _Res > && __uf)
[inline], [noexcept] β move constructor. References std::move(). She's moving out and she's taking everything with her, no cap. π§³
π Member Function Documentation π
template<typename _Res>
__result_type std::__basic_future< _Res >::_M_get_result () const
[inline], [protected], [inherited] β wait for the state to be ready and rethrow any stored exception.
Referenced by std::future< _Res >::get(), and std::shared_future< _Res >::get().
template<typename _Res>
_Res std::future< _Res >::get () [inline]
Retrieving the value. The moment we've all been waiting for β¨
References std::__basic_future< _Res >::_M_get_result(), and std::move().
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. Not a human, not a vibe, just a robot doing its best. π€
okay bestie that's the whole page, every flag, every signature, every reference, all present and accounted for. π
This has been your girl from the libstdc++ manual, page std::future< _Res >(3), source and version: libstdc++, generated straight from the source code by Doxygen. Bye babes, go get() that value π«Άβ¨
π¦ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms