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 --- src/handle.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/handle.cpp') diff --git a/src/handle.cpp b/src/handle.cpp index 2260aa3..916b8ae 100644 --- a/src/handle.cpp +++ b/src/handle.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include @@ -21,9 +20,8 @@ namespace winapi { namespace { std::runtime_error write_file_incomplete(std::size_t expected, std::size_t actual) { - std::ostringstream oss; - oss << "WriteFile could only write " << actual << " bytes instead of " << expected; - return std::runtime_error{oss.str()}; + return std::runtime_error{ + std::format("WriteFile could only write {} bytes instead of {}", actual, expected)}; } bool is_std_handle(HANDLE handle) { -- cgit v1.3