Add foreach loop support to Span type

This commit is contained in:
Wojtek Figat
2023-10-17 09:53:48 +02:00
parent d92c7af2cf
commit cebae5c4e1

View File

@@ -107,6 +107,26 @@ public:
ASSERT(index >= 0 && index < _length);
return _data[index];
}
FORCE_INLINE T* begin()
{
return _data;
}
FORCE_INLINE T* end()
{
return _data + _length;
}
FORCE_INLINE const T* begin() const
{
return _data;
}
FORCE_INLINE const T* end() const
{
return _data + _length;
}
};
template<typename T>