15 Slice() : mData(
nullptr), mSize(0) {}
16 Slice(T* data,
size_t size) : mData(data), mSize(size) {}
18 Slice(
const Slice& other) : mData(other.mData), mSize(other.mSize) {}
32 T& operator[](
size_t index) {
37 const T& operator[](
size_t index)
const {
50 size_t length()
const {
54 const T* data()
const {
66 Slice<T> slice(
size_t start,
size_t end)
const {
68 return Slice<T>(mData + start, end - start);
73 return Slice<T>(mData + start, mSize - start);
78 size_t find(
const T& value)
const {
79 for (
size_t i = 0; i < mSize; ++i) {
80 if (mData[i] == value) {