mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:07:44 +00:00
AK: Add span() / bytes() methods to container types.
This commit is contained in:
parent
c42450786c
commit
a922abd9d7
4 changed files with 24 additions and 5 deletions
|
@ -137,6 +137,9 @@ public:
|
|||
ALWAYS_INLINE bool is_empty() const { return length() == 0; }
|
||||
ALWAYS_INLINE size_t length() const { return m_impl ? m_impl->length() : 0; }
|
||||
ALWAYS_INLINE const char* characters() const { return m_impl ? m_impl->characters() : nullptr; }
|
||||
|
||||
ALWAYS_INLINE ReadonlyBytes bytes() const { return m_impl ? m_impl->bytes() : nullptr; }
|
||||
|
||||
ALWAYS_INLINE const char& operator[](size_t i) const
|
||||
{
|
||||
return (*m_impl)[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue