STD::__BASIC_FUTURE(3)
β¨ NAME β¨
std::__basic_future< _Res > β bestie, this is the common implementation for future and shared_future. it's the shared backbone, the group chat both of them are in π
π¦ SYNOPSIS π¦
#include <future>
so like. this class is the momager. it's inherited by std::future< _Res & >, std::shared_future< _Res & >, std::future< _Res >, and std::shared_future< _Res >. iconic lineage fr fr π
πΈ Public Member Functions πΈ
__basic_future (const __basic_future &)=deleteβ copying is not it, sorry. deleted constructor, no copies allowed, we're exclusive π__basic_future & operator= (const __basic_future &)=deleteβ and the copy assignment is deleted too. no hand-me-downs, no duplicates β¨bool valid () const noexceptβ tells you if the state is, like, actually there.noexceptso it will never throw at you, we love a low-drama queen πvoid wait () constβ sit there and wait. no return value, just vibes and patience πtemplate<typename _Rep, typename _Period> future_status wait_for (const chrono::duration< _Rep, _Period > &__rel) constβ wait for a relative lil chunk of time (__rel) and hand you back afuture_statusβ³template<typename _Clock, typename _Duration> future_status wait_until (const chrono::time_point< _Clock, _Duration > &__abs) constβ wait until an absolute time point (__abs) and hand you back afuture_statusπ°οΈ
π₯ Protected Types π₯
typedef __future_base::_Result< _Res > & __result_typeβ the result type, it's a reference to__future_base::_Result< _Res >πtypedef shared_ptr< _State_base > __state_typeβ the state type, ashared_ptrto_State_base, shared custody energy π«Ά
π Protected Member Functions π
__basic_future (const __state_type &__state)β protected constructor taking the state (__state) π__basic_future (const shared_future< _Res > &) noexceptβ protected, takes aconst shared_future< _Res > &, and it'snoexceptβ¨__basic_future (future< _Res > &&) noexceptβ protected, takes afuture< _Res > &&(rvalue ref, move-only energy),noexceptπ«__basic_future (shared_future< _Res > &&) noexceptβ protected, takes ashared_future< _Res > &&, alsonoexceptπΈ__result_type _M_get_result () constβ Wait for the state to be ready and rethrow any stored exception. so it blocks, then if there's an exception hiding in there, it gets yeeted right back at you π€void _M_swap (__basic_future &__that) noexceptβ protected, swaps with__that,noexcept, no chaos allowed π
π Detailed Description π
template<typename _Res>
class std::__basic_future< _Res >
"Common implementation for future and shared_future.
that's literally the whole lore. the template parameter is _Res, and this is the shared secret sauce behind both of them π§
π Member Function Documentation π
template<typename _Res> __result_type std::__basic_future< _Res >::_M_get_result () const [inline], [protected]
Wait for the state to be ready and rethrow any stored exception.
it's [inline], it's [protected], and it's doing the most for both of its children π
Referenced by std::future< _Res >::get(), and std::shared_future< _Res >::get(). so like, both get()s are leaning on this one. periodt π
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. (yes bestie, a robot wrote it, we still stan π€π)
and that's the whole page!! this is from the libstdc++ manual, section3βstd::__bas...ure< _Res >(3). mwah, go read the source if you wanna know more, i love you, bye π«Άβ¨π
π¦ 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