diff options
| author | Egor Tensin <egor@tensin.name> | 2026-06-04 23:00:02 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-06-04 23:00:02 +0200 |
| commit | 3333f7cc6e5bee683ae7349ed86304e20db5a675 (patch) | |
| tree | 81d2d574b9a21af6f9e56325fba8dc418ad7b3e3 /src/process.cpp | |
| parent | upgrade to std::optional (diff) | |
| download | winapi-common-3333f7cc6e5bee683ae7349ed86304e20db5a675.tar.gz winapi-common-3333f7cc6e5bee683ae7349ed86304e20db5a675.zip | |
upgrade to std::format
Diffstat (limited to '')
| -rw-r--r-- | src/process.cpp | 10 |
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); |
