Cast padded_string to string_view instead of string

This commit is contained in:
John Keiser 2020-03-27 09:13:11 -07:00
parent c14b2fb36c
commit e3efbcddc1
2 changed files with 3 additions and 3 deletions

View File

@ -98,7 +98,7 @@ inline const char *padded_string::data() const noexcept { return data_ptr; }
inline char *padded_string::data() noexcept { return data_ptr; }
inline padded_string::operator std::string() const { return std::string(data(), length()); }
inline padded_string::operator std::string_view() const { return std::string_view(data(), length()); }
inline simdjson_result<padded_string> padded_string::load(const std::string &filename) noexcept {
// Open the file

View File

@ -90,9 +90,9 @@ struct padded_string final {
char *data() noexcept;
/**
* Create a new std::string with the same content.
* Create a std::string_view with the same content.
*/
operator std::string() const;
operator std::string_view() const;
/**
* Load this padded string from a file.