diff options
| author | Egor Tensin <egor@tensin.name> | 2026-06-05 15:45:24 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-06-05 15:54:16 +0200 |
| commit | dc7d7bc45d9b6cb3a052d69fbdacbd33b9ff3796 (patch) | |
| tree | ab42a7e61784d97478e2b73f9e31ff400ccbbe09 /src/module.cpp | |
| parent | upgrade winapi-common (diff) | |
| download | winapi-debug-dc7d7bc45d9b6cb3a052d69fbdacbd33b9ff3796.tar.gz winapi-debug-dc7d7bc45d9b6cb3a052d69fbdacbd33b9ff3796.zip | |
upgrade to std::format
Diffstat (limited to 'src/module.cpp')
| -rw-r--r-- | src/module.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/module.cpp b/src/module.cpp index 47d8eaf..ae4a95f 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -7,8 +7,8 @@ #include <winapi/utf8.hpp> #include <cstring> +#include <format> #include <limits> -#include <sstream> #include <stdexcept> #include <string> @@ -59,17 +59,17 @@ Address Module::translate_online_address(Address online) const { } std::string Module::invalid_offline_address(Address offline) const { - std::ostringstream oss; - oss << "offline address " << address::format(offline) << " doesn't belong to module " - << get_name() << " (base offline address " << address::format(get_offline_base()) << ')'; - return oss.str(); + return std::format("offline address {} doesn't belong to module {} (base offline address {})", + address::format(offline), + get_name(), + address::format(get_offline_base())); } std::string Module::invalid_online_address(Address online) const { - std::ostringstream oss; - oss << "online address " << address::format(online) << " doesn't belong to module " - << get_name() << " (base online address " << address::format(get_online_base()) << ')'; - return oss.str(); + return std::format("online address {} doesn't belong to module {} (base online address {})", + address::format(online), + get_name(), + address::format(get_online_base())); } } // namespace winapi |
