From 415ac0aded9821205a34065a2ccae802c499fec3 Mon Sep 17 00:00:00 2001 From: slipher Date: Sat, 1 Nov 2025 08:40:27 -0500 Subject: [PATCH] Add StringRef pointer + length constructor --- src/common/String.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/String.h b/src/common/String.h index 06de46fda2..85f2876031 100644 --- a/src/common/String.h +++ b/src/common/String.h @@ -52,6 +52,11 @@ namespace Str { : ptr(other.c_str()), len(other.size()) {} BasicStringRef(const T* other) : ptr(other), len(std::char_traits::length(other)) {} + BasicStringRef(const T* start, size_t len) + : ptr(start), len(len) + { + DAEMON_ASSERT_EQ(start[len], '\0'); + } const T& operator[](size_t pos) const {