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 __uf into your new future, noexcept and 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 a shared_future< _Res >, noexcept. Sharing is caring 🫢
  • bool valid () const noexcept β€” is this future actually holding a shared state? const and noexcept, 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 a future_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 absolute chrono::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_task
  • class 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