AK: Add Span<T> constructor for arrays

The array constructor allows arrays to be easily treated
as generic span of data.
This commit is contained in:
Brian Gianforcaro 2021-02-21 01:59:08 -08:00 committed by Andreas Kling
parent 3019445492
commit 21a959e29b
Notes: sideshowbarker 2024-07-18 22:03:40 +09:00

View file

@ -46,6 +46,13 @@ public:
{
}
template<size_t size>
ALWAYS_INLINE constexpr Span(T (&values)[size])
: m_values(values)
, m_size(size)
{
}
protected:
T* m_values { nullptr };
size_t m_size { 0 };