About 663,000 results
Open links in new tab
  1. std::future - cppreference.com

    Mar 12, 2024 · The class template std::future provides a mechanism to access the result of asynchronous operations: An asynchronous operation (created via std::async, …

  2. Standard library header <future> (C++11) - cppreference.com

    Nov 27, 2023 · future (const future &) = delete; ~future (); future & operator =(const future &) = delete; future & operator =(future &&) noexcept; shared_future <R> share () noexcept; // …

  3. std::future<T>::wait_for - cppreference.com

    Aug 27, 2021 · If the future is the result of a call to std::async that used lazy evaluation, this function returns immediately without waiting. This function may block for longer than …

  4. std::future<T>::get - cppreference.com

    Feb 22, 2024 · The get member function waits (by calling wait ()) until the shared state is ready, then retrieves the value stored in the shared state (if any). Right after calling this function, valid …

  5. std::future<T>::valid - cppreference.com

    Aug 27, 2021 · Checks if the future refers to a shared state. This is the case only for futures that were not default-constructed or moved from (i.e. returned by std::promise::get_future (), …

  6. How can one await a result of a boxed future? - Stack Overflow

    Mar 6, 2020 · impl<F> Future for Box<F> where F: Unpin + Future + ?Sized, Boxed futures only implement the Future trait when the future inside the Box implements Unpin. Since your …

  7. c++ - Futures vs. Promises - Stack Overflow

    Sep 27, 2012 · Future and Promise are the two separate sides of an asynchronous operation. std::promise is used by the "producer/writer" of the asynchronous operation. std::future is used …

  8. std::future_status - cppreference.com

    Mar 19, 2025 · Specifies state of a future as returned by wait_for and wait_until functions of std::future and std::shared_future. Constants

  9. std::future<T>::wait_until - cppreference.com

    Aug 2, 2020 · If the future is the result of a call to async that used lazy evaluation, this function returns immediately without waiting. The behavior is undefined if valid () is false before the call …

  10. std::promise<R>:: get_future - cppreference.com

    Mar 11, 2024 · Returns a future object associated with the same shared state as *this. An exception is thrown if *this has no shared state or get_future has already been called. To get …