mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
AK: Add slice() overload to Span.
This commit is contained in:
parent
36080c5964
commit
525d51bbb5
|
@ -148,6 +148,12 @@ public:
|
|||
return { this->m_values + start, size };
|
||||
}
|
||||
|
||||
ALWAYS_INLINE Span slice(size_t start) const
|
||||
{
|
||||
ASSERT(start < this->m_size);
|
||||
return { this->m_values + start, this->m_size - start };
|
||||
}
|
||||
|
||||
ALWAYS_INLINE T* offset(size_t start) const
|
||||
{
|
||||
ASSERT(start < this->m_size);
|
||||
|
|
Loading…
Reference in a new issue