Skip to content

Commit

Permalink
const char *
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc committed Feb 17, 2024
1 parent b38ce30 commit b4569ea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/stim/arg_parse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,9 @@ double stim::parse_exact_double_from_string(std::string_view text) {
if (text.starts_with("+")) {
text = text.substr(1);
}
const char *end = text.data() + text.size();
std::from_chars_result result = std::from_chars(text.data(), end, out);
const char *start = text.data();
const char *end = start + text.size();
std::from_chars_result result = std::from_chars(start, end, out);
if (result.ptr == end && !text.empty() && !isspace(text.front()) && !isspace(text.back()) && !std::isinf(out) &&
!std::isnan(out)) {
return out;
Expand Down

0 comments on commit b4569ea

Please sign in to comment.