summaryrefslogtreecommitdiffstatshomepage
path: root/src/handle.cpp
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-06-04 23:00:02 +0200
committerEgor Tensin <egor@tensin.name>2026-06-04 23:00:02 +0200
commit3333f7cc6e5bee683ae7349ed86304e20db5a675 (patch)
tree81d2d574b9a21af6f9e56325fba8dc418ad7b3e3 /src/handle.cpp
parentupgrade to std::optional (diff)
downloadwinapi-common-3333f7cc6e5bee683ae7349ed86304e20db5a675.tar.gz
winapi-common-3333f7cc6e5bee683ae7349ed86304e20db5a675.zip
upgrade to std::format
Diffstat (limited to 'src/handle.cpp')
-rw-r--r--src/handle.cpp6
1 files changed, 2 insertions, 4 deletions
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 <cassert>
#include <cstddef>
#include <limits>
-#include <sstream>
#include <stdexcept>
#include <utility>
@@ -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) {