diff options
author | Andreas Kling <kling@serenityos.org> | 2020-06-07 20:53:30 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-07 21:05:05 +0200 |
commit | 83ee76a53e34417f147c846e61f0eeddaf8e1d03 (patch) | |
tree | 11326d43602d92c57f70b524bface545e7ed8273 | |
parent | 1fadde2483df7f8930c92138484cab3a4b604088 (diff) | |
download | serenity-83ee76a53e34417f147c846e61f0eeddaf8e1d03.zip |
AK: Add StringView::{begin,end} so we can range-for over StringViews
-rw-r--r-- | AK/StringView.h | 3 |
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 }; |