Yahoo Web Search

Search results

  1. Oct 23, 2023 · 1) Base template. 2) Non-void specialization, used to communicate objects between threads. 3) void specialization, used to communicate stateless events. The class template std::promise provides a facility to store a value or an exception that is later acquired asynchronously via a std::future object created by the std::promise object.

  2. Mar 12, 2024 · std:: future. future. An asynchronous operation (created via std::async, std::packaged_task, or std::promise) can provide a std::future object to the creator of that asynchronous operation. The creator of the asynchronous operation can then use a variety of methods to query, wait for, or extract a value from the std::future.

  3. Aug 16, 2023 · static coroutine_handle from_promise( Promise& p ); (since C++20) Creates a coroutine_handle from the promise object of a coroutine. The created coroutine_handle refers the coroutine, and promise () returns a reference to p. The behavior is undefined if p is not a reference to a promise object. This function is only provided for the primary ...

  4. Sep 4, 2024 · the coroutine handle, manipulated from outside the coroutine. This is a non-owning handle used to resume execution of the coroutine or to destroy the coroutine frame. the coroutine state, which is internal, dynamically-allocated storage (unless the allocation is optimized out), object that contains. the promise object.

  5. Oct 23, 2023 · std::promise<R>:: promise. promise. Constructs a promise object. 1) Default constructor. Constructs the promise with an empty shared state. 2) Constructs the promise with an empty shared state. The shared state is allocated using alloc. Alloc must meet the requirements of Allocator. 3) Move constructor.

  6. Feb 25, 2024 · std::promise<void> specialization. void set_value(); (4) (since C++11) 1-3) Atomically stores value into the shared state and makes the state ready. 4) Makes the state ready. The operation behaves as though set_value, set_exception, set_value_at_thread_exit, and set_exception_at_thread_exit acquire a single mutex associated with the promise ...

  7. Mar 11, 2024 · uses_allocator<std::promise>. std::future<R> get_future(); (since C++11) 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 multiple "pop" ends of the promise-future communication channel, use std::future::share.

  8. Oct 23, 2023 · atomic_compare_exchange_weak atomic_compare_exchange_weak_explicit atomic_compare_exchange_strong atomic_compare_exchange_strong_explicit

  9. Oct 23, 2023 · std::promise<R>:: set_exception. set_exception. Atomically stores the exception pointer p into the shared state and makes the state ready. The operation behaves as though set_value, set_exception, set_value_at_thread_exit, and set_exception_at_thread_exit acquire a single mutex associated with the promise object while updating the promise object.

  10. Aug 27, 2021 · std::future<T>:: wait. wait. Blocks until the result becomes available. valid() == true after the call. The behavior is undefined if valid() == false before the call to this function.

  1. People also search for