1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:07:45 +00:00

AK: Add begin() and end() to String and StringView

Now it's possible to use range-based for loops with String and StringView.
This commit is contained in:
howar6hill 2020-03-10 16:13:29 +08:00 committed by Andreas Kling
parent a0e18f4450
commit e07f50c398
3 changed files with 15 additions and 6 deletions

View file

@ -26,8 +26,8 @@
#pragma once
#include <AK/RefPtr.h>
#include <AK/RefCounted.h>
#include <AK/RefPtr.h>
#include <AK/Types.h>
#include <AK/kmalloc.h>
@ -57,7 +57,7 @@ public:
size_t length() const { return m_length; }
const char* characters() const { return &m_inline_buffer[0]; }
char operator[](size_t i) const
const char& operator[](size_t i) const
{
ASSERT(i < m_length);
return characters()[i];