From a281897abda13ac9c8d86832370c235416aad174 Mon Sep 17 00:00:00 2001 From: codepuncher Date: Sat, 20 Jun 2026 13:14:22 +0100 Subject: [PATCH] chore: document TrimWhitespace string_view lifetime requirement --- src/Utils.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Utils.h b/src/Utils.h index d306df2..0e5ba14 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -8,6 +8,8 @@ namespace HoldFast { + // Returns a view into `s`, so the caller must keep that buffer alive for as long + // as the returned view is used (do not pass a temporary std::string). [[nodiscard]] inline std::string_view TrimWhitespace(std::string_view s) { const auto first = s.find_first_not_of(" \t\r\n");