mirror of https://github.com/OpenTTD/OpenTTD
Add: subspan function to span
parent
7a785a4224
commit
2aa48bfcb3
|
@ -96,6 +96,12 @@ public:
|
||||||
|
|
||||||
constexpr pointer data() const noexcept { return first; }
|
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:
|
private:
|
||||||
pointer first;
|
pointer first;
|
||||||
pointer last;
|
pointer last;
|
||||||
|
|
Loading…
Reference in New Issue