From 2dee41f3de91d71bde9678b860f9566cccb6995f Mon Sep 17 00:00:00 2001 From: Philip Top Date: Wed, 28 Jul 2021 15:20:47 -0700 Subject: [PATCH] fix conversion bug when not using boost on C++17 --- gmlc/utilities/string_viewConversion.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gmlc/utilities/string_viewConversion.h b/gmlc/utilities/string_viewConversion.h index 14e0355..93c6ce3 100644 --- a/gmlc/utilities/string_viewConversion.h +++ b/gmlc/utilities/string_viewConversion.h @@ -120,7 +120,7 @@ namespace utilities { x3::parse(V.cbegin(), V.cend(), x3::double_, retVal); return retVal; #else - return std::stod(V.to_string()); + return std::stod(std::string(V.data(), V.length())); #endif } @@ -133,7 +133,7 @@ namespace utilities { x3::parse(V.cbegin(), V.cend(), x3::float_, retVal); return retVal; #else - return std::stof(V.to_string()); + return std::stof(std::string(V.data(), V.length())); #endif }