Cast padded_string to string_view instead of string
This commit is contained in:
parent
c14b2fb36c
commit
e3efbcddc1
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue