|
|
Non-member functions | ||||
Helper classes | ||||
Defined in header <future> | ||
enumclass future_errc{ broken_promise =/* implementation-defined */, | (since C++11) | |
The scoped enumerationstd::future_errc
defines the error codes reported bystd::future and related classes instd::future_error exception objects. Only four error codes are required, although the implementation may define additional error codes. Because the appropriate specialization ofstd::is_error_code_enum is provided, values of typestd::future_errc
are implicitly convertible tostd::error_code.
All error codes are distinct and non-zero.
Contents |
Enumerator | Meaning |
broken_promise | the asynchronous task abandoned its shared state |
future_already_retrieved | the contents of shared state were already accessed throughstd::future |
promise_already_satisfied | attempt to store a value in the shared state twice |
no_state | attempt to accessstd::promise orstd::future without an associated shared state |
constructs a future error code (function)[edit] | |
constructs a futureerror_condition (function)[edit] |
extends the type traitstd::is_error_code_enum to identify future error codes (class template)[edit] |
This section is incomplete Reason: no example |
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR | Applied to | Behavior as published | Correct behavior |
---|---|---|---|
LWG 2056 | C++11 | broken_promise was specified to be zero which is conventionally used to mean “no error” | specified to be non-zero |
(C++11) | holds a platform-dependent error code (class)[edit] |
(C++11) | holds a portable error code (class)[edit] |