From b4569eab579f5e80822d30daffa893f7dde793f0 Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Fri, 16 Feb 2024 17:34:44 -0800 Subject: [PATCH] const char * --- src/stim/arg_parse.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/stim/arg_parse.cc b/src/stim/arg_parse.cc index a976f8e4b..403e92f33 100644 --- a/src/stim/arg_parse.cc +++ b/src/stim/arg_parse.cc @@ -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;