public member function
<system_error>
std::error_code::error_code
| (1) | error_code() noexcept; |
|---|---|
| (2) | error_code (int val, const error_category& cat) noexcept; |
| (3) | template <class ErrorCodeEnum> error_code (ErrorCodeEnum e) noexcept; |
Construct error_code
- default constructor (1)
- Error code with a value of 0 of the system_category (generally indicating no error).
- initialization constructor (2)
- Error code with a value of val of the category specified by cat.
- construct from error code enum type (3)
- Calls make_error_code to construct an error code.
This constructor only participates in overload resolution ifis_error_code_enum<ErrorCodeEnum>::valueistrue.
Parameters
- val
- A numerical value identifying an error code.
- cat
- A reference to an error_category object.
- e
- Error code enum value of an enum type for which is_error_code_enum has a value member with a value of true.
Example
|
|
Possible output (cout):
See also
- error_code::operator=
- Assign error code (public member function)
- error_code::assign
- Assign error code (public member function)
- error_code::clear
- Clear error code (public member function)