/** *Representsanarrayof`T`(mustbeatrivialtype)thatcannotgrowpastafixedsize`N`. *Thefixed-sizerestrictionallowsfortightercodegenandasmallermemoryfootprint. *MissingmethodsfromTArray(e.g.`fromBack`)canbeaddedondemand. * *Thetrivial-typerestrictionisonlytosimplifyimplementation;ifthereisaneed,wecan *adoptpropermove/copysemanticsinthisclassaswell.
*/ template <int N, typename T> class FixedArray {
public:
using value_type = T;
FixedArray() = default;
FixedArray(std::initializer_list<T> values) {
SkASSERT(values.size() <= N); for (T value : values) {
fData[fSize++] = value;
}
}
FixedArray(int reserveCount) { // This is here to satisfy the TArray interface. Setting a reserve count on a fixed array // isn't useful.
SkASSERT(reserveCount >= 0);
SkASSERT(reserveCount <= N);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.