summaryrefslogtreecommitdiffstatshomepage
path: root/src/process.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/process.cpp
parentupgrade to std::optional (diff)
downloadwinapi-common-3333f7cc6e5bee683ae7349ed86304e20db5a675.tar.gz
winapi-common-3333f7cc6e5bee683ae7349ed86304e20db5a675.zip
upgrade to std::format
Diffstat (limited to 'src/process.cpp')
-rw-r--r--src/process.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/process.cpp b/src/process.cpp
index e0799d5..5886c41 100644
--- a/src/process.cpp
+++ b/src/process.cpp
@@ -18,8 +18,8 @@
#include <cstddef>
#include <cstring>
+#include <format>
#include <limits>
-#include <sstream>
#include <stdexcept>
#include <string>
#include <utility>
@@ -384,11 +384,9 @@ Resource Process::get_resource(uint32_t id) {
const auto data = ::LockResource(resource);
- if (data == NULL) {
- std::ostringstream oss;
- oss << "Couldn't get data pointer for resource with ID " << id;
- throw std::runtime_error{oss.str()};
- }
+ if (data == NULL)
+ throw std::runtime_error{
+ std::format("Couldn't get data pointer for resource with ID {}", id)};
const auto nb = ::SizeofResource(module, src);