summaryrefslogtreecommitdiff
path: root/AK/FixedArray.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-11 17:38:13 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-11 17:42:31 +0200
commit373b8d7cfa5cc08203a884fdd2026221f76c49b5 (patch)
treed5c6d410ad63b07376758e008ebc63a1f4403f79 /AK/FixedArray.h
parent7d096a1287caa79b697fbb7da515104353dc3592 (diff)
downloadserenity-373b8d7cfa5cc08203a884fdd2026221f76c49b5.zip
AK: Add FixedArray::span()
Diffstat (limited to 'AK/FixedArray.h')
-rw-r--r--AK/FixedArray.h3
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 };