From 4827f4cdbf9988d41ba1d1ddbb080e784496b4b9 Mon Sep 17 00:00:00 2001 From: ttldtor Date: Mon, 1 Apr 2024 00:50:11 +0300 Subject: [PATCH] At the moment, clang\apple clang does not support a version of the `from_chars` function (needed for `std::string_view`) for the `double` type. --- include/dxfeed_graal_cpp_api/internal/Common.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/dxfeed_graal_cpp_api/internal/Common.hpp b/include/dxfeed_graal_cpp_api/internal/Common.hpp index 8fdb376f..0889e5e1 100644 --- a/include/dxfeed_graal_cpp_api/internal/Common.hpp +++ b/include/dxfeed_graal_cpp_api/internal/Common.hpp @@ -741,15 +741,15 @@ struct StringLikeWrapper { // At the moment, clang\apple clang's std lib does not support a version of the `from_chars` function (needed // for `std::string_view`) for the `double` type. - if constexpr (isLibCPP) { - auto s = this->operator std::string(); +#ifdef _LIBCPP_VERSION + auto s = this->operator std::string(); - result = std::stod(s); - } else { - auto sw = this->operator std::string_view(); + result = std::stod(s); +#else + auto sw = this->operator std::string_view(); - std::from_chars(sw.data(), sw.data() + sw.size(), result); - } + std::from_chars(sw.data(), sw.data() + sw.size(), result); +#endif return result; }