std::experi...ared_future(3)

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

πŸ’– NAME πŸ’–

Okay bestie, this page is std::experi...ared_future(3), and the manual it comes from is the C++ Standard Libary manual. The NAME section is literally std::experimental::shared_future β€” copy-paste energy, but make it fashion. πŸ’…


✨ Synopsis ✨

Defined in header <experimental/shared_future>

template< class T > class shared_future;       (1) (concurrency TS)
template< class T > class shared_future<T&>;   (2) (concurrency TS)
template<>          class shared_future<void>; (3) (concurrency TS)

The class template std::experimental::shared_future extends std::shared_future with the following operations:

  • an unwrapping constructor from future<shared_future<T>>;
  • a member function is_ready to query whether the associated shared state is ready; and
  • a member function then to attach a continuation to the future.

There is no interoperation between std::experimental::shared_future and std::shared_future. That's not a vibe check fail, it's just the rules, bestie. 🫢


🌟 Member functions 🌟

  • constructor β€” constructs a shared_future (public member function)
  • is_ready β€” checks if the shared state is ready (public member function)
  • then β€” attaches a continuation to a shared_future (public member function)
  • operator= β€” assigns the contents (public member function)

🌸 Members identical to std::shared_future 🌸

πŸ’« Member functions πŸ’«

  • destructor β€” destructs the future object (public member function of std::shared_future<T>)

πŸ“ Getting the result πŸ“

  • get β€” returns the result (public member function of std::shared_future<T>)

🌈 State 🌈

  • valid β€” checks if the future has a shared state (public member function of std::shared_future<T>)
  • wait β€” waits for the result to become available (public member function of std::shared_future<T>)
  • wait_for β€” waits for the result, returns if it is not available for the specified timeout duration (public member function of std::shared_future<T>)
  • wait_until β€” waits for the result, returns if it is not available until specified time point has been reached (public member function of std::shared_future<T>)

🚧 Example 🚧

This section is incomplete.

Reason: no example


πŸ‘€ See also πŸ‘€

  • future β€” a version of std::future enhanced with continuations and other (concurrency TS) features (class template)

🏷️ Category 🏷️

  • Todo no example

Alright bestie, that's the whole page. Sign-off time: source/version is http://cppreference.com, date is 2024.06.10, and the page is std::experi...ared_future(3). Slay, read responsibly, and may your shared states always be ready. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from