std::experi...eady_future(3)

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

πŸ’– NAME πŸ’–

std::experimental::make_ready_future - std::experimental::make_ready_future. Yes bestie, the name is literally the name twice, no cap πŸ’….

✨ Synopsis ✨

Okay so first thing: it's Defined in header <experimental/future> πŸ¦‹. Here's the exact declaration vibe:

template< class T >                                       (1)
       (concurrency TS)
          future<V /* see below */> make_ready_future( T&& value );
          future<void> make_ready_future();                         (2)
       (concurrency TS)

Then the numbered tea β˜•:

  1. If std::decay_t<T> is std::reference_wrapper<X>, then the type V is X&; otherwise, V is std::decay_t<T>. This creates a shared state of type V that is immediately ready, with the result constructed from std::forward<T>(value), then returns a std::experimental::future associated with that shared state. πŸ’–
  2. This creates a shared state of type void that is immediately ready, then returns a std::experimental::future associated with that shared state. ✨

πŸ¦‹ Return value πŸ¦‹

A std::experimental::future associated with the shared state that is created. That's the whole vibe 🫢.

πŸŽ€ See also πŸŽ€

  • make_exceptional_future β€” produces a future that is ready immediately and holds the given exception (concurrency TS) (function template). πŸ”₯

mwah πŸ’‹ β€” source: http://cppreference.com, version/date: 2024.06.10, for the std::experi...eady_future(3) page.

πŸ“¦ where this page comes from