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:
Treeston
2020-08-27 21:26:14 +02:00
committed by Shauren
parent 2154251ac7
commit 6e45c371c4

View File

@@ -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;