23 #ifndef LELY_UTIL_ERROR_HPP_
24 #define LELY_UTIL_ERROR_HPP_
29 #include <system_error>
38 inline ::std::error_code
39 make_error_code(
int errc =
get_errc()) noexcept {
40 return {errc, ::std::generic_category()};
47 [[noreturn]]
inline void
49 throw ::std::system_error(::std::make_error_code(e));
57 [[noreturn]]
inline void
59 throw ::std::system_error(::std::make_error_code(e), what_arg);
63 [[noreturn]]
inline void
65 throw ::std::system_error(::std::make_error_code(e), what_arg);
72 [[noreturn]]
inline void
74 throw ::std::system_error(make_error_code(errc));
83 [[noreturn]]
inline void
85 throw ::std::system_error(make_error_code(errc), what_arg);
89 [[noreturn]]
inline void
91 throw ::std::system_error(make_error_code(errc), what_arg);
98 [[noreturn]]
inline void
109 [[noreturn]]
inline void
115 [[noreturn]]
inline void
This header file is part of the utilities library; it contains the native and platform-independent er...
int errnum2c(errnum_t errnum)
Transforms a platform-independent error number to a native error code.
errnum
The platform-independent error numbers.
int get_errc(void)
Returns the last (thread-specific) native error code set by a system call or library function.
void throw_error_code(::std::errc e)
Throws an std::system_error exception corresponding to the specified error code.
void throw_errnum(int errnum)
Throws an std::system_error exception corresponding to the specified platform-independent error numbe...
void throw_errc(int errc=get_errc())
Throws an std::system_error exception corresponding to the specified or current (thread-specific) nat...