BLI: Add slice method to MutableSpan
Span had a slice method with an IndexRange argument, but MutableSpan did not, yet. This commit makes the two types consistent.
This commit is contained in:
parent
675d3cdd69
commit
9793bc30ce
|
@ -599,6 +599,11 @@ template<typename T> class MutableSpan {
|
|||
return MutableSpan(data_ + start, new_size);
|
||||
}
|
||||
|
||||
constexpr MutableSpan slice(IndexRange range) const
|
||||
{
|
||||
return this->slice(range.start(), range.size());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new MutableSpan with n elements removed from the beginning. This invokes
|
||||
* undefined behavior when n is negative.
|
||||
|
|
Loading…
Reference in New Issue