diff --git a/include/pqxx/array.hxx b/include/pqxx/array.hxx index cc98b4516..b841cfaf6 100644 --- a/include/pqxx/array.hxx +++ b/include/pqxx/array.hxx @@ -595,7 +595,7 @@ private: template std::string::size_type scan_unquoted_string() const; template - std::string parse_unquoted_string(std::string::size_type end) const; + std::string_view parse_unquoted_string(std::string::size_type end) const; template std::string::size_type scan_glyph(std::string::size_type pos) const; diff --git a/include/pqxx/internal/array-composite.hxx b/include/pqxx/internal/array-composite.hxx index c86fc9e22..689dd7300 100644 --- a/include/pqxx/internal/array-composite.hxx +++ b/include/pqxx/internal/array-composite.hxx @@ -143,10 +143,9 @@ scan_unquoted_string(char const input[], std::size_t size, std::size_t pos) } -// XXX: Retire this. Just construct a string_view directly now! /// Parse an unquoted array entry or cfield of a composite-type field. template -inline std::string +inline std::string_view parse_unquoted_string(char const input[], std::size_t end, std::size_t pos) { return {&input[pos], end - pos}; diff --git a/src/array.cxx b/src/array.cxx index ec38d5c59..2484d3052 100644 --- a/src/array.cxx +++ b/src/array.cxx @@ -80,7 +80,7 @@ std::string::size_type array_parser::scan_unquoted_string() const * that happens to spell "NULL". */ template -std::string +std::string_view array_parser::parse_unquoted_string(std::string::size_type end) const { return pqxx::internal::parse_unquoted_string(