mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 17:31:58 -05:00
AK: Add slice() overload to Span.
This commit is contained in:
parent
36080c5964
commit
525d51bbb5
1 changed files with 6 additions and 0 deletions
|
@ -148,6 +148,12 @@ public:
|
||||||
return { this->m_values + start, size };
|
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
|
ALWAYS_INLINE T* offset(size_t start) const
|
||||||
{
|
{
|
||||||
ASSERT(start < this->m_size);
|
ASSERT(start < this->m_size);
|
||||||
|
|
Loading…
Reference in a new issue