STD::FUTURE(3cxx)

🌸 std::future< _Res > 🌸

okay so bestie, we're in the cxx manual and this page is all about std::future< _Res >. it's giving β€œprimary template for future” energy, and every single signature is preserved below because we do not play about details. πŸ’–

✨ NAME ✨

std::future< _Res > β€” the primary template for future. periodt. πŸ‘‘

🌸 SYNOPSIS 🌸

#include <future>

Inherits std::__basic_future< _Res >. 🫢

πŸ’… Public Member Functions πŸ’…

  • future (const future &)=delete β€” this one is marked =delete; the page gives the signature and no extra blurb. πŸ’€
  • future (future &&__uf) noexcept β€” Move constructor. slay, we love a move. ✨
  • _Res get () β€” Retrieving the value. the main character function fr fr. πŸ’–
  • future & operator= (const future &)=delete β€” deleted assignment signature, exactly as listed. 🚫
  • future & operator= (future &&__fut) noexcept β€” move assignment signature, no extra description attached. πŸŒ€
  • shared_future< _Res > share () noexcept β€” share() is right here, signature only. 🫢
  • bool valid () const noexcept β€” the valid() check, signature only. βœ…
  • void wait () const β€” wait(), signature only. ⏳
  • template<typename _Rep , typename _Period > future_status wait_for (const chrono::duration< _Rep, _Period > &__rel) const β€” the wait_for template, copied exactly with all its template bits. ⏱️
  • template<typename _Clock , typename _Duration > future_status wait_until (const chrono::time_point< _Clock, _Duration > &__abs) const β€” the wait_until template, also copied exactly. πŸ•°οΈ

πŸ›‘οΈ Protected Types πŸ›‘οΈ

  • typedef __future_base::_Result< _Res > & __result_type β€” protected type alias, kept character for character. 🧚

πŸ”’ Protected Member Functions πŸ”’

  • __result_type _M_get_result () const β€” Wait for the state to be ready and rethrow any stored exception. yes, it says β€œrethrow” and we respect it. 😭
  • void _M_swap (__basic_future &__that) noexcept β€” swappy signature, no extra description on the page. πŸ”

🫢 Friends 🫢

  • template<typename _Fn , typename... _Args> future< __async_result_of< _Fn, _Args... > > async (launch, _Fn &&, _Args &&...) β€” friend async declaration, exactly as listed. πŸš€
  • template<typename > class packaged_task β€” friend packaged_task, with that space before > preserved. πŸ“¦
  • class promise< _Res > β€” friend promise< _Res >, right here. 🀝

πŸ¦‹ Detailed Description πŸ¦‹

template<typename _Res>
    class std::future< _Res >

Primary template for future. literally the blueprint, no cap. 🌈

tiny detail from the source page: the class line has a little quote-mark artifact in the original text, so I'm keeping that on the record rather than β€œfixing” it. bestie, we preserve the lore. πŸ’…

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

🧚 future

template<typename _Res > std::future< _Res >::future (future< _Res > && __uf) [inline],  [noexcept]

Move constructor. that's it, that's the constructor note. ✨

⭐ Member Function Documentation ⭐

πŸ’œ _M_get_result

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. 🫒

References std::rethrow_exception().

πŸ’– get

template<typename _Res > _Res std::future< _Res >::get () [inline]

Retrieving the value. the one you're probably here for, lowkey. 🌟

References std::move().

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. iconic autogenerated behavior, honestly. πŸŽ€


xoxo, libstdc++ πŸ’– this page's footer says libstdc++ and std::future< _Res >(3cxx), so that's the source/version plus the manual name, and there's no separate date printed. mwah πŸ’…

πŸ“¦ where this page comes from