mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 06:15:38 +00:00
StringUtil: Fix for older gcc versions again
This commit is contained in:
parent
fcc0ae9571
commit
19c1e8b838
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue