2#ifdef USE_INITIALIZER_LIST
82#ifdef USE_INITIALIZER_LIST
85 Vector(std::initializer_list<T> iniList) {
88 for (
auto &obj : iniList) {
111 for (
int j = 0; j <
size; j++) {
133 for (
int j = 0; j < copyFrom.
len; j++) {
140 template <
typename TT,
int N>
143 for (
int j = 0; j < N; j++) {
152 for (
int j = 0; j < copyFrom.
len; j++) {
162 this->
len = to - from;
164 for (
size_t j = 0; j < this->
len; j++) {
197 for (
int j =
len - 1; j >= 0; j--) {
207 for (
int j =
len - 1; j >= 0; j--) {
223 size_t newLen = v2 - v1;
227 for (
auto ptr = v1; ptr != v2; ptr++) {
235 for (
int j = 0; j < number; j++) {
268 for (
int j = 0; j < newSize; j++) {
286 int oldSize = this->
len;
289 return this->
len != oldSize &&
data() !=
nullptr;
304 int lenToEnd =
len - pos - 1;
308 memmove((
void *)&
p_data[pos], (
void *)(&
p_data[pos + 1]),
309 lenToEnd *
sizeof(T));
312#if defined(NO_INPLACE_INIT_SUPPORT)
326 for (
int j = 0; j <
size(); j++) {
327 if (
p_data[j] == obj)
return j;
347 other.bufferLen = temp_blen;
348 other.len = temp_len;
349 other.p_data = temp_data;
373 if (newCapacity < 4) newCapacity = 4;
374 if (newCapacity < newSize) newCapacity = newSize;
379 if (newSize <= 0)
return;
380 if (newSize >
bufferLen || this->p_data ==
nullptr || shrink) {
384 bool out_of_memory =
p_data ==
nullptr;
394 this->bufferLen = newSize;
395 if (oldData !=
nullptr) {
396 if (copy && this->len > 0) {
398 memmove((
void*)
p_data, (
void*)oldData,
len *
sizeof(T));
400 memset((
void*)oldData, 0,
len *
sizeof(T));
403 cleanup(oldData, newSize, oldBufferLen);
415 data =
new T[newSize];
430 for (
int j = from; j < to; j++) {
#define assert(T)
Definition avr.h:10