diff options
author | Andreas Kling <kling@serenityos.org> | 2021-07-11 17:38:13 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-11 17:42:31 +0200 |
commit | 373b8d7cfa5cc08203a884fdd2026221f76c49b5 (patch) | |
tree | d5c6d410ad63b07376758e008ebc63a1f4403f79 | |
parent | 7d096a1287caa79b697fbb7da515104353dc3592 (diff) | |
download | serenity-373b8d7cfa5cc08203a884fdd2026221f76c49b5.zip |
AK: Add FixedArray::span()
-rw-r--r-- | AK/FixedArray.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/AK/FixedArray.h b/AK/FixedArray.h index ddcbc6c47a..b32ccd2e84 100644 --- a/AK/FixedArray.h +++ b/AK/FixedArray.h @@ -101,6 +101,9 @@ public: ConstIterator end() const { return ConstIterator::end(*this); } Iterator end() { return Iterator::end(*this); } + Span<T const> span() const { return { data(), size() }; } + Span<T> span() { return { data(), size() }; } + private: size_t m_size { 0 }; T* m_elements { nullptr }; |