mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
Cast padded_string to string_view instead of string
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user