StringUtil: Fix for older gcc versions again

This commit is contained in:
Connor McLaughlin 2020-02-28 17:12:49 +10:00
parent fcc0ae9571
commit 19c1e8b838

View file

@ -5,7 +5,7 @@
#include <optional>
#include <string>
#if __cplusplus >= 201703L
#if defined(__has_include) && __has_include(<charconv>)
#include <charconv>
#else
#include <sstream>
@ -39,8 +39,7 @@ std::optional<T> FromChars(const std::string_view str)
{
T value;
#if __cplusplus >= 201703L
T value;
#if defined(__has_include) && __has_include(<charconv>)
const std::from_chars_result result = std::from_chars(str.data(), str.data() + str.length(), value);
if (result.ec != std::errc())
return std::nullopt;