mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
Add: subspan function to span
This commit is contained in:
parent
7a785a4224
commit
2aa48bfcb3
@ -96,6 +96,12 @@ public:
|
||||
|
||||
constexpr pointer data() const noexcept { return first; }
|
||||
|
||||
constexpr span<element_type> subspan(size_t offset, size_t count)
|
||||
{
|
||||
assert(offset + count <= size());
|
||||
return span(this->data() + offset, count);
|
||||
}
|
||||
|
||||
private:
|
||||
pointer first;
|
||||
pointer last;
|
||||
|
Loading…
Reference in New Issue
Block a user