STD::SHARED_FUTURE(3)
π NAME π
std::shared_future< _Res > β the primary template for shared_future, bestie. That's it, that's the name. π
β¨ SYNOPSIS β¨
okay so first things first, you gotta pull it in:
#include <future>
and heads up, it inherits std::__basic_future< _Res > β it's giving legacy, it's giving family tree. π³
πΈ Public Member Functions πΈ
shared_future (const shared_future &__sf) noexceptβ the copy constructor, no cap.shared_future (future< _Res > &&__uf) noexceptβ construct from afuturervalue, literally.shared_future (shared_future &&__sf) noexceptβ construct from ashared_futurervalue. yes queen, move it. πconst _Res & get () constβ retrieving the value. the main character moment tbh.shared_future & operator= (const shared_future &__sf) noexceptshared_future & operator= (shared_future &&__sf) noexceptbool valid () const noexceptvoid wait () consttemplate<typename _Rep, typename _Period> future_status wait_for (const chrono::duration< _Rep, _Period > &__rel) consttemplate<typename _Clock, typename _Duration> future_status wait_until (const chrono::time_point< _Clock, _Duration > &__abs) const
π Protected Types π
typedef __future_base::_Result< _Res > & __result_typetypedef shared_ptr< _State_base > __state_type
π¦ Protected Member Functions π¦
__result_type _M_get_result () constβ wait for the state to be ready and rethrow any stored exception. dramatic? maybe. necessary? absolutely. πvoid _M_swap (__basic_future &__that) noexcept
π Detailed Description π
template<typename _Res>
class std::shared_future< _Res >
"Primary template for shared_future." periodt. π
π Constructor & Destructor Documentation π
template<typename _Res> std::shared_future< _Res >::shared_future (const
shared_future< _Res > & __sf) [inline], [noexcept]
Copy constructor. that's the whole vibe. β¨
template<typename _Res> std::shared_future< _Res >::shared_future (future<
_Res > && __uf) [inline], [noexcept]
Construct from a future rvalue.
References std::move().
template<typename _Res> std::shared_future< _Res >::shared_future
(shared_future< _Res > && __sf) [inline], [noexcept]
Construct from a shared_future rvalue.
References std::move().
π 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. like, it will absolutely tell you if something went wrong, and honestly? iconic of it. π₯
Referenced bystd::future< _Res >::get(), andstd::shared_future< _Res >::get().
template<typename _Res> const _Res & std::shared_future< _Res >::get ()
const [inline]
Retrieving the value. the moment we've all been waiting for, fr fr. π«Ά
References std::__basic_future< _Res >::_M_get_result().
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. not a human author, just a little robot bestie doing its thing. π€π
okay so that's the whole page β this came from the libstdc++ manual, and the page you just read is std::shared_future< _Res >(3), living under the "Library Functions Manual" umbrella. mwah, love that for us. bye bestie, go make some shared state and stay hydrated π
πΈπ¦
π¦ 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