diff --git a/include/string_span.h b/include/string_span.h index 6b0b32b..d3419ee 100644 --- a/include/string_span.h +++ b/include/string_span.h @@ -270,7 +270,7 @@ public: // from string constexpr basic_string_span(std::string& s) noexcept - : span_(&(s.at(0)), narrow_cast(s.length())) + : span_(const_cast(s.data()), narrow_cast(s.length())) {} // from containers. Containers must have .size() and .data() function signatures