From 3333f7cc6e5bee683ae7349ed86304e20db5a675 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 4 Jun 2026 23:00:02 +0200 Subject: upgrade to std::format --- include/winapi/error.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'include/winapi/error.hpp') diff --git a/include/winapi/error.hpp b/include/winapi/error.hpp index 35e10f0..30237e3 100644 --- a/include/winapi/error.hpp +++ b/include/winapi/error.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include @@ -44,9 +44,7 @@ std::system_error windows(DWORD code, const char* function); template std::runtime_error custom(Ret ret, const char* function) { - std::ostringstream oss; - oss << "Function " << function << " failed with error code " << ret; - return std::runtime_error{oss.str()}; + return std::runtime_error{std::format("Function {} failed with error code {}", function, ret)}; } } // namespace error -- cgit v1.3