Skip to content

Commit

Permalink
fix conversion bug when not using boost on C++17
Browse files Browse the repository at this point in the history
  • Loading branch information
phlptp committed Jul 28, 2021
1 parent d98448f commit 2dee41f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gmlc/utilities/string_viewConversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down

0 comments on commit 2dee41f

Please sign in to comment.