summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-06-07 20:53:30 +0200
committerAndreas Kling <kling@serenityos.org>2020-06-07 21:05:05 +0200
commit83ee76a53e34417f147c846e61f0eeddaf8e1d03 (patch)
tree11326d43602d92c57f70b524bface545e7ed8273
parent1fadde2483df7f8930c92138484cab3a4b604088 (diff)
downloadserenity-83ee76a53e34417f147c846e61f0eeddaf8e1d03.zip
AK: Add StringView::{begin,end} so we can range-for over StringViews
-rw-r--r--AK/StringView.h3
1 files changed, 3 insertions, 0 deletions
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 };