mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Common/Utilities: Properly read std::from_chars documentation and check for out_of_range errors.
(cherry picked from commit 7478c2c65a)
This commit is contained in:
@@ -69,7 +69,7 @@ namespace Trinity::Impl::StringConvertImpl
|
||||
|
||||
T val;
|
||||
std::from_chars_result const res = std::from_chars(start, end, val, base);
|
||||
if (res.ptr == end)
|
||||
if ((res.ptr == end) && (res.ec == std::errc()))
|
||||
return val;
|
||||
else
|
||||
return std::nullopt;
|
||||
|
||||
Reference in New Issue
Block a user