std::future_errc
科技促进发展:未来[医]ERRC
Defined in header | | |
---|
enum class future_errc { broken_promise = /* implementation-defined */, future_already_retrieved = /* implementation-defined */, promise_already_satisfied = /* implementation-defined */, no_state = /* implementation-defined */ }; | | (since C++11) |
范围枚举std::future_errc
定义报告的错误代码。std::future
及相关课程std::future_error
异常对象。只需要四个错误代码,尽管实现可以定义其他错误代码。因为适当的专门化std::is_error_code_enum
提供类型的值。std::future_errc
隐式可转换为std::error_code
...
All error codes are distinct and non-zero. | (since C++14) |
---|
成员常数
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 |
非会员职能
make_error_code(std::future_errc) (C++11) | constructs a future error code (function) |
---|
make_error_condition(std::future_errc) (C++11) | constructs a future error_condition (function) |
帮助者类
is_error_code_enum (C++11) | extends the type trait std::is_error_code_enum to identify future error codes (class template) |
---|
注记
在C++11中,broken_promise
被指定为等于零,尽管std::error_code
/std::error_condition
用零表示“没有错误”。这是在C++14中修正的。
例
另见
error_code (C++11) | holds a platform-dependent error code (class) |
---|
error_condition (C++11) | holds a portable error code (class) |
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
http://en.cppreference.com/w/cpp/线程/前途[医]ERRC