8#ifndef SkTFixedArray_DEFINED
9#define SkTFixedArray_DEFINED
15#include <initializer_list>
28template <
int N,
typename T>
38 fData[fSize++] =
value;
75 return fSize == that.fSize && (0 == memcmp(fData, that.fData, fSize *
sizeof(
T)));
98 std::memcpy(fData, array,
count *
sizeof(
T));
105 if (fSize > newSize) {
108 while (fSize < newSize) {
109 fData[fSize++] =
T();
116 T& ref = fData[fSize++];
133 int last = fSize - 1;
135 fData[n] = fData[last];
157 return fData + fSize;
161 return fData + fSize;
176 return fData[fSize - 1];
181 return fData[fSize - 1];
195 static_assert(std::is_trivial_v<T>);
196 static_assert(
N > 0);
197 static_assert(
N < 256);
T & operator[](size_t index)
FixedArray(const T *array, int count)
bool operator==(const FixedArray< N, T > &that) const
FixedArray(int reserveCount)
const T & operator[](size_t index) const
FixedArray(const FixedArray< N, T > &that)
FixedArray(std::initializer_list< T > values)
constexpr int capacity() const
bool operator!=(const FixedArray< N, T > &that) const
void removeShuffle(int n)
void reset(const T *array, int count)
FixedArray< N, T > & operator=(const FixedArray< N, T > &that)