diff options
| author | Egor Tensin <egor@tensin.name> | 2026-06-05 17:47:31 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-06-05 17:47:31 +0200 |
| commit | dfcebbeae9d982b8e2a42197b2892334b665de2d (patch) | |
| tree | 182339f03eae894aad97f0fc55b0d8438c4ef62d /include/winapi/debug/address.hpp | |
| parent | upgrade to std::optional (diff) | |
| download | winapi-debug-dfcebbeae9d982b8e2a42197b2892334b665de2d.tar.gz winapi-debug-dfcebbeae9d982b8e2a42197b2892334b665de2d.zip | |
upgrade to std::string_view
Diffstat (limited to 'include/winapi/debug/address.hpp')
| -rw-r--r-- | include/winapi/debug/address.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/winapi/debug/address.hpp b/include/winapi/debug/address.hpp index a5f186e..9fe6e2b 100644 --- a/include/winapi/debug/address.hpp +++ b/include/winapi/debug/address.hpp @@ -10,6 +10,7 @@ #include <charconv> #include <format> #include <string> +#include <string_view> namespace winapi { @@ -25,9 +26,9 @@ inline std::string format(void* address) { return format(reinterpret_cast<Address>(address)); } -inline bool parse(Address& dest, const std::string& src) { +inline bool parse(Address& dest, std::string_view src) { Address result; - const auto [ptr, ec] = std::from_chars(src.c_str(), src.c_str() + src.length(), result, 16); + const auto [ptr, ec] = std::from_chars(src.data(), src.data() + src.length(), result, 16); if (ec == std::errc()) { dest = result; return true; |
