9 Slice() : mData(
nullptr), mSize(0) {}
10 Slice(T* data,
size_t size) : mData(data), mSize(size) {}
12 Slice(
const Slice& other) : mData(other.mData), mSize(other.mSize) {}
26 T& operator[](
size_t index) {
31 const T& operator[](
size_t index)
const {
44 size_t length()
const {
48 const T* data()
const {
60 Slice<T> slice(
size_t start,
size_t end)
const {
62 return Slice<T>(mData + start, end - start);
67 return Slice<T>(mData + start, mSize - start);
72 size_t find(
const T& value)
const {
73 for (
size_t i = 0; i < mSize; ++i) {
74 if (mData[i] == value) {