From 19c1e8b8385778cb96936d6a7aea7c3518ee6997 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 28 Feb 2020 17:12:49 +1000 Subject: [PATCH] StringUtil: Fix for older gcc versions again --- src/common/string_util.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/common/string_util.h b/src/common/string_util.h index 6380d775b..7c2af92ec 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h @@ -5,7 +5,7 @@ #include #include -#if __cplusplus >= 201703L +#if defined(__has_include) && __has_include() #include #else #include @@ -39,8 +39,7 @@ std::optional FromChars(const std::string_view str) { T value; -#if __cplusplus >= 201703L - T value; +#if defined(__has_include) && __has_include() const std::from_chars_result result = std::from_chars(str.data(), str.data() + str.length(), value); if (result.ec != std::errc()) return std::nullopt;