Skip to content

Commit

Permalink
lib/fmt/SystemError: add VFmtErrno()
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Jul 21, 2023
1 parent acc92b1 commit 1c37b04
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib/fmt/SystemError.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ FmtLastError(const S &format_str, Args&&... args) noexcept

#endif // _WIN32

[[nodiscard]] [[gnu::pure]]
inline std::system_error
VFmtErrno(int code,
fmt::string_view format_str, fmt::format_args args) noexcept
{
return VFmtSystemError(std::error_code(code, ErrnoCategory()),
format_str, args);
}

template<typename S, typename... Args>
requires(std::is_convertible_v<S, fmt::string_view>)
[[nodiscard]] [[gnu::pure]]
Expand Down

0 comments on commit 1c37b04

Please sign in to comment.