4.2 KiB
[future.syn]
32 Concurrency support library [thread]
32.10 Futures [futures]
32.10.2 Header synopsis [future.syn]
namespace std {enum class future_errc {broken_promise = implementation-defined, future_already_retrieved = implementation-defined, promise_already_satisfied = implementation-defined, no_state = implementation-defined}; enum class launch : unspecified {async = unspecified, deferred = unspecified, implementation-defined}; enum class future_status {ready, timeout, deferred}; // [futures.errors], error handlingtemplate<> struct is_error_code_enum<future_errc> : public true_type { }; error_code make_error_code(future_errc e) noexcept; error_condition make_error_condition(future_errc e) noexcept; const error_category& future_category() noexcept; // [futures.future.error], class future_errorclass future_error; // [futures.promise], class template promisetemplate class promise; template class promise<R&>; template<> class promise; templatevoid swap(promise& x, promise& y) noexcept; // [futures.unique.future], class template futuretemplate class future; template class future<R&>; template<> class future; // [futures.shared.future], class template shared_futuretemplate class shared_future; template class shared_future<R&>; template<> class shared_future; // [futures.task], class template packaged_tasktemplate class packaged_task; // not definedtemplate<class R, class... ArgTypes>class packaged_task<R(ArgTypes...)>; template<class R, class... ArgTypes>void swap(packaged_task<R(ArgTypes...)>&, packaged_task<R(ArgTypes...)>&) noexcept; // [futures.async], function template asynctemplate<class F, class... Args> future<invoke_result_t<decay_t, decay_t...>> async(F&& f, Args&&... args); template<class F, class... Args> future<invoke_result_t<decay_t, decay_t...>> async(launch policy, F&& f, Args&&... args);}
The enum type launch is a bitmask type ([bitmask.types]) with elements launch::async and launch::deferred.
[Note 1:
Implementations can provide bitmasks to specify restrictions on task interaction by functions launched by async() applicable to a corresponding subset of available launch policies.
Implementations can extend the behavior of the first overload of async() by adding their extensions to the launch policy under the âas ifâ rule.
â end note]
The enum values of future_errc are distinct and not zero.