std::experi...damentalsTS)(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– std::experimental::packaged_task(libraryfundamentalsTS) πŸ’–

okay so bestie, this is the std::experi...damentalsTS)(3) page from the C++ Standard Libary, and we are literally here for std::experimental::packaged_task. it’s giving experimental-TS main character energy, and we’re gonna keep every detail, no cap. 🫢

🌸 NAME 🌸

std::experimental::packaged_task(libraryfundamentalsTS) β€” std::experimental::packaged_task(libraryfundamentalsTS)

✨ Synopsis ✨

the whole synopsis vibe is right here, bestie:

Defined in header <experimental/future>
template< class > class packaged_task; //not defined (1) (library
fundamentals TS)
template< class R, class ...Args >                   (2) (library
fundamentals TS)
class packaged_task<R(Args...)>;

so std::experimental::fundamentals_v1::packaged_task (and std::experimental::fundamentals_v2::packaged_task) is a modified version of std::packaged_task provided by the library fundamentals TS with support for type-erased allocators. literally the whole plot. πŸ’…

πŸŽ€ Member types πŸŽ€

  • allocator_type β€” definition: std::experimental::erased_type ✨

πŸ’… Member functions πŸ’…

  • constructor β€” constructs the task object (public member function)
  • get_memory_resource β€” retrieves a pointer to the memory resource used by this object to allocate memory (public member function)

πŸ” Non-member function πŸ”

  • std::experimental::swap(std::experimental::packaged_task) β€” specializes the swap algorithm (function template)

🧚 Helper classes 🧚

  • std::uses_allocator<std::experimental::packaged_task> β€” specializes the std::uses_allocator type trait (class template specialization)

πŸ‘‘ Members identical to std::packaged_task πŸ‘‘

these are the members that are identical to std::packaged_task, and yes, we are listing every single one. periodt. πŸ’œ

🌈 Member functions 🌈

  • destructor β€” destructs the task object (public member function of std::packaged_task<R(Args...)>)
  • operator= β€” moves the task object (public member function of std::packaged_task<R(Args...)>)
  • valid β€” checks if the task object has a valid function (public member function of std::packaged_task<R(Args...)>)
  • swap β€” swaps two task objects (public member function of std::packaged_task<R(Args...)>)

πŸ¦‹ Getting the result πŸ¦‹

  • get_future β€” returns a std::future associated with the promised result (public member function of std::packaged_task<R(Args...)>)

πŸ”₯ Execution πŸ”₯

  • operator() β€” executes the function (public member function of std::packaged_task<R(Args...)>)
  • make_ready_at_thread_exit β€” executes the function ensuring that the result is ready only once the current thread exits (public member function of std::packaged_task<R(Args...)>)
  • reset β€” resets the state abandoning any stored results of previous executions (public member function of std::packaged_task<R(Args...)>)

source/version/date sign-off, bestie: this page is from http://cppreference.com, dated 2024.06.10, under the std::experi...damentalsTS)(3) manual. that’s the whole footer vibe πŸ’–βœ¨

πŸ“¦ where this page comes from