[future.syn] # 32 Concurrency support library [[thread]](./#thread) ## 32.10 Futures [[futures]](futures#future.syn) ### 32.10.2 Header synopsis [future.syn] [🔗](#header:%3cfuture%3e) namespace std {enum class [future_errc](#lib:future_errc "32.10.2 Header synopsis [future.syn]") {[broken_promise](#lib:future_errc,broken_promise "32.10.2 Header synopsis [future.syn]") = *implementation-defined*, [future_already_retrieved](#lib:future_errc,future_already_retrieved "32.10.2 Header synopsis [future.syn]") = *implementation-defined*, [promise_already_satisfied](#lib:future_errc,promise_already_satisfied "32.10.2 Header synopsis [future.syn]") = *implementation-defined*, [no_state](#lib:future_errc,no_state "32.10.2 Header synopsis [future.syn]") = *implementation-defined*}; enum class [launch](#lib:launch "32.10.2 Header synopsis [future.syn]") : *unspecified* {[async](#lib:launch,async "32.10.2 Header synopsis [future.syn]") = *unspecified*, [deferred](#lib:launch,deferred "32.10.2 Header synopsis [future.syn]") = *unspecified*, *implementation-defined*}; enum class [future_status](#lib:future_status "32.10.2 Header synopsis [future.syn]") {[ready](#lib:future_status,ready "32.10.2 Header synopsis [future.syn]"), [timeout](#lib:future_status,timeout "32.10.2 Header synopsis [future.syn]"), [deferred](#lib:future_status,deferred "32.10.2 Header synopsis [future.syn]")}; // [[futures.errors]](futures.errors "32.10.3 Error handling"), error handlingtemplate<> struct is_error_code_enum : 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]](futures.future.error "32.10.4 Class future_­error"), class future_errorclass future_error; // [[futures.promise]](futures.promise "32.10.6 Class template promise"), class template promisetemplate class promise; template class promise; template<> class promise; templatevoid swap(promise& x, promise& y) noexcept; // [[futures.unique.future]](futures.unique.future "32.10.7 Class template future"), class template futuretemplate class future; template class future; template<> class future; // [[futures.shared.future]](futures.shared.future "32.10.8 Class template shared_­future"), class template shared_futuretemplate class shared_future; template class shared_future; template<> class shared_future; // [[futures.task]](futures.task "32.10.10 Class template packaged_­task"), class template packaged_tasktemplate class packaged_task; // *not defined*templateclass packaged_task; templatevoid swap(packaged_task&, packaged_task&) noexcept; // [[futures.async]](futures.async "32.10.9 Function template async"), function template asynctemplate future, decay_t...>> async(F&& f, Args&&... args); template future, decay_t...>> async(launch policy, F&& f, Args&&... args);} [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L11204) The enum type launch is a bitmask type ([[bitmask.types]](bitmask.types "16.3.3.3.3 Bitmask types")) with elements launch​::​async and launch​::​deferred[.](#1.sentence-1) [*Note [1](#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[.](#1.sentence-2) Implementations can extend the behavior of the first overload of async() by adding their extensions to the launch policy under the “as if” rule[.](#1.sentence-3) — *end note*] [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L11215) The enum values of future_errc are distinct and not zero[.](#2.sentence-1)