function

std::make_error_code

<system_error>
error_code make_error_code (errc e) noexcept;
Make error code
Creates an error_code object from the errc enum value e (of the generic_category).

It returns the same as
 
error_code(static_cast<int>(e),generic_category());


This function is called by error_code's constructor for error code enum types, and should be overloaded for all error code enum types defined in order to provide a mechanism to generate the appropriate error_code objects from them.

Parameters

e
An enum value of type errc (see errc).

Return value

An error_code object representing the enum value e.

See also