From 83ee76a53e34417f147c846e61f0eeddaf8e1d03 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 7 Jun 2020 20:53:30 +0200 Subject: [PATCH] AK: Add StringView::{begin,end} so we can range-for over StringViews --- AK/StringView.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AK/StringView.h b/AK/StringView.h index 2df811db58..1606dc66e1 100644 --- a/AK/StringView.h +++ b/AK/StringView.h @@ -156,6 +156,9 @@ public: String to_string() const; + const char* begin() { return m_characters; } + const char* end() { return m_characters + m_length; } + private: friend class String; const StringImpl* m_impl { nullptr };