generic template (1) | void set_value_at_thread_exit (const T& val);void set_value_at_thread_exit (T&& val); |
---|---|
specializations (2) | void promise<R&>::set_value_at_thread_exit (R& val); // when T is a reference type (R&)void promise<void>::set_value_at_thread_exit (void); // when T is void |
exception type | error condition | 描述 |
---|---|---|
future_error | future_errc::no_state | 该对象没有共享状态(它已被移动赋值) |
future_error | future_errc::promise_already_satisfied | 共享状态已存储值或异常 |