Namespaces
Variants
Views
Actions

std::future_errc

From cppreference.com
< cpp‎ | thread
Revision as of 20:54, 2 November 2012 by P12bot (Talk | contribs)

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <ios>
</td>

<td></td> <td></td> <tr class="t-dcl ">

<td >
enum class future_errc {

    broken_promise,
    future_already_retrieved,
    promise_already_satisfied,
    no_state

};
</td>

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> Template:ddcl list end

The scoped enumeration std::future_errc defines the error codes reported by std::future and related classes in std::future_error exception objects. Only four error codes are required, although the implementation may define additional error codes. Because the appropriate specialization of std::is_error_code_enum is provided, values of type std::future_errc are implicitly convertible to std::error_code.

Contents

Member constants

Constant Explanation
broken_promise the asynchronous task abandoned its shared state
future_already_retrieved the contents of shared state were already accessed through std::future
promise_already_satisfied attempt to store a value in the shared state twice
no_state attempt to access std::promise or std::future without an associated shared state

Helper classes

extends the type trait std::is_error_code_enum to identify future error codes
(class template)

Non-member functions

constructs a future error code
(function)
constructs a future error_condition
(function)

Example

See also

Template:cpp/error/dcl list error codeTemplate:cpp/error/dcl list error condition