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 a future rvalue, literally.
  • shared_future (shared_future &&__sf) noexcept β€” construct from a shared_future rvalue. yes queen, move it. πŸ’…
  • const _Res & get () const β€” retrieving the value. the main character moment tbh.
  • shared_future & operator= (const shared_future &__sf) noexcept
  • shared_future & operator= (shared_future &&__sf) noexcept
  • bool valid () const noexcept
  • void wait () const
  • template<typename _Rep, typename _Period> future_status wait_for (const chrono::duration< _Rep, _Period > &__rel) const
  • template<typename _Clock, typename _Duration> future_status wait_until (const chrono::time_point< _Clock, _Duration > &__abs) const

πŸŽ€ Protected Types πŸŽ€

  • typedef __future_base::_Result< _Res > & __result_type
  • typedef 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 by std::future< _Res >::get(), and std::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