1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-27 08:29:11 +00:00

Add: subspan function to span

This commit is contained in:
Rubidium
2023-06-17 11:59:06 +02:00
committed by rubidium42
parent 7a785a4224
commit 2aa48bfcb3

View File

@@ -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;