diff --git a/src/util/string.h b/src/util/string.h index 265bf987e50..fd0255d1625 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -160,7 +160,7 @@ std::vector Split(const std::span& sp, char sep, bool include_sep return Split(str, separators); } -[[nodiscard]] inline std::string_view TrimStringView(std::string_view str, std::string_view pattern = " \f\n\r\t\v") +[[nodiscard]] inline std::string_view TrimStringView(std::string_view str LIFETIMEBOUND, std::string_view pattern = " \f\n\r\t\v") { std::string::size_type front = str.find_first_not_of(pattern); if (front == std::string::npos) { @@ -175,7 +175,7 @@ std::vector Split(const std::span& sp, char sep, bool include_sep return std::string(TrimStringView(str, pattern)); } -[[nodiscard]] inline std::string_view RemoveSuffixView(std::string_view str, std::string_view suffix) +[[nodiscard]] inline std::string_view RemoveSuffixView(std::string_view str LIFETIMEBOUND, std::string_view suffix) { if (str.ends_with(suffix)) { return str.substr(0, str.size() - suffix.size()); @@ -183,7 +183,7 @@ std::vector Split(const std::span& sp, char sep, bool include_sep return str; } -[[nodiscard]] inline std::string_view RemovePrefixView(std::string_view str, std::string_view prefix) +[[nodiscard]] inline std::string_view RemovePrefixView(std::string_view str LIFETIMEBOUND, std::string_view prefix) { if (str.starts_with(prefix)) { return str.substr(prefix.size()); @@ -273,7 +273,7 @@ class LineReader std::string_view::iterator m_it; public: - explicit LineReader(std::string_view str, size_t max_line_length); + explicit LineReader(std::string_view str LIFETIMEBOUND, size_t max_line_length); /** * Returns a string from current iterator position up to (but not including) next \n