добавил const для части контейнеров и explicit для конструкторов
This commit is contained in:
@@ -75,9 +75,9 @@
|
||||
//! if the number of elements is known beforehand.
|
||||
//!
|
||||
//! The complexity (efficiency) of common operations on PIDeque is as follows:
|
||||
//! - Random access - constant 𝓞(1)
|
||||
//! - Insertion or removal of elements at the end or begin - amortized constant 𝓞(1)
|
||||
//! - Insertion or removal of elements - linear in the distance to the end of the array 𝓞(n)
|
||||
//! - Random access - constant O(1)
|
||||
//! - Insertion or removal of elements at the end or begin - amortized constant O(1)
|
||||
//! - Insertion or removal of elements - linear in the distance to the end of the array O(n)
|
||||
//!
|
||||
//! \~russian
|
||||
//! Элементы хранятся непрерывно, а значит доступны не только через итераторы,
|
||||
@@ -109,9 +109,9 @@
|
||||
//! если количество элементов известно заранее.
|
||||
//!
|
||||
//! Сложность (эффективность) обычных операций над PIDeque следующая:
|
||||
//! - Произвольный доступ — постоянная 𝓞(1)
|
||||
//! - Вставка и удаление элементов в конце или начале — амортизированная постоянная 𝓞(1)
|
||||
//! - Вставка и удаление элементов — линейная по расстоянию до конца массива 𝓞(n)
|
||||
//! - Произвольный доступ — постоянная O(1)
|
||||
//! - Вставка и удаление элементов в конце или начале — амортизированная постоянная O(1)
|
||||
//! - Вставка и удаление элементов — линейная по расстоянию до конца массива O(n)
|
||||
//!
|
||||
//! \~\sa \a PIVector, \a PIMap
|
||||
template<typename T>
|
||||
@@ -164,7 +164,7 @@ public:
|
||||
|
||||
//! \~english Contructs array with size `size` filled elements `e`.
|
||||
//! \~russian Создает массив из `size` элементов заполненных `e`.
|
||||
inline PIDeque(size_t pid_size, const T & e = T()) {
|
||||
inline explicit PIDeque(size_t pid_size, const T & e = T()) {
|
||||
PIINTROSPECTION_CONTAINER_NEW(T, sizeof(T))
|
||||
expand(pid_size, e);
|
||||
}
|
||||
@@ -249,7 +249,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
inline iterator operator++(int) {
|
||||
auto tmp = *this;
|
||||
const auto tmp = *this;
|
||||
++*this;
|
||||
return tmp;
|
||||
}
|
||||
@@ -258,7 +258,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
inline iterator operator--(int) {
|
||||
auto tmp = *this;
|
||||
const auto tmp = *this;
|
||||
--*this;
|
||||
return tmp;
|
||||
}
|
||||
@@ -328,7 +328,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
inline const_iterator operator++(int) {
|
||||
auto tmp = *this;
|
||||
const auto tmp = *this;
|
||||
++*this;
|
||||
return tmp;
|
||||
}
|
||||
@@ -337,7 +337,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
inline const_iterator operator--(int) {
|
||||
auto tmp = *this;
|
||||
const auto tmp = *this;
|
||||
--*this;
|
||||
return tmp;
|
||||
}
|
||||
@@ -409,7 +409,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
inline reverse_iterator operator++(int) {
|
||||
auto tmp = *this;
|
||||
const auto tmp = *this;
|
||||
--*this;
|
||||
return tmp;
|
||||
}
|
||||
@@ -418,7 +418,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
inline reverse_iterator operator--(int) {
|
||||
auto tmp = *this;
|
||||
const auto tmp = *this;
|
||||
++*this;
|
||||
return tmp;
|
||||
}
|
||||
@@ -487,7 +487,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
inline const_reverse_iterator operator++(int) {
|
||||
auto tmp = *this;
|
||||
const auto tmp = *this;
|
||||
--*this;
|
||||
return tmp;
|
||||
}
|
||||
@@ -496,7 +496,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
inline const_reverse_iterator operator--(int) {
|
||||
auto tmp = *this;
|
||||
const auto tmp = *this;
|
||||
++*this;
|
||||
return tmp;
|
||||
}
|
||||
@@ -729,7 +729,7 @@ public:
|
||||
//! заданному в передаваемой функции `test`, или `def` если такого элемента нет.
|
||||
//! \~\sa \a indexWhere()
|
||||
inline const T & atWhere(std::function<bool(const T & e)> test, ssize_t start = 0, const T & def = T()) const {
|
||||
ssize_t i = indexWhere(test, start);
|
||||
const ssize_t i = indexWhere(test, start);
|
||||
if (i < 0)
|
||||
return def;
|
||||
else
|
||||
@@ -743,7 +743,7 @@ public:
|
||||
//! заданному в передаваемой функции `test`, или `def` если такого элемента нет.
|
||||
//! \~\sa \a lastIndexWhere()
|
||||
inline const T & lastAtWhere(std::function<bool(const T & e)> test, ssize_t start = -1, const T & def = T()) const {
|
||||
ssize_t i = lastIndexWhere(test, start);
|
||||
const ssize_t i = lastIndexWhere(test, start);
|
||||
if (i < 0)
|
||||
return def;
|
||||
else
|
||||
@@ -1302,7 +1302,7 @@ public:
|
||||
//! \~\sa \a size(), \a capacity(), \a resize()
|
||||
inline PIDeque<T> & reserve(size_t new_size) {
|
||||
if (new_size <= pid_rsize) return *this;
|
||||
size_t os = pid_size;
|
||||
const size_t os = pid_size;
|
||||
alloc_forward(new_size);
|
||||
pid_size = os;
|
||||
return *this;
|
||||
@@ -1322,17 +1322,21 @@ public:
|
||||
inline PIDeque<T> & insert(size_t index, const T & e = T()) {
|
||||
if (index == pid_size) return push_back(e);
|
||||
PIINTROSPECTION_CONTAINER_USED(T, 1)
|
||||
bool dir = pid_rsize <= 2 ? true : (index >= pid_rsize / 2 ? true : false);
|
||||
const bool dir = pid_rsize <= 2 ? true : (index >= pid_rsize / 2 ? true : false);
|
||||
if (dir) {
|
||||
alloc_forward(pid_size + 1);
|
||||
if (index < pid_size - 1) {
|
||||
size_t os = pid_size - index - 1;
|
||||
memmove((void *)(pid_data + pid_start + index + 1), (const void *)(pid_data + pid_start + index), os * sizeof(T));
|
||||
const size_t os = pid_size - index - 1;
|
||||
memmove(reinterpret_cast<void *>(pid_data + pid_start + index + 1),
|
||||
reinterpret_cast<const void *>(pid_data + pid_start + index),
|
||||
os * sizeof(T));
|
||||
}
|
||||
} else {
|
||||
alloc_backward(pid_size + 1, -1);
|
||||
if (index > 0) {
|
||||
memmove((void *)(pid_data + pid_start), (const void *)(pid_data + pid_start + 1), index * sizeof(T));
|
||||
memmove(reinterpret_cast<void *>(pid_data + pid_start),
|
||||
reinterpret_cast<const void *>(pid_data + pid_start + 1),
|
||||
index * sizeof(T));
|
||||
}
|
||||
}
|
||||
elementNew(pid_data + pid_start + index, e);
|
||||
@@ -1348,17 +1352,21 @@ public:
|
||||
inline PIDeque<T> & insert(size_t index, T && e) {
|
||||
if (index == pid_size) return push_back(e);
|
||||
PIINTROSPECTION_CONTAINER_USED(T, 1)
|
||||
bool dir = pid_rsize <= 2 ? true : (index >= pid_rsize / 2 ? true : false);
|
||||
const bool dir = pid_rsize <= 2 ? true : (index >= pid_rsize / 2 ? true : false);
|
||||
if (dir) {
|
||||
alloc_forward(pid_size + 1);
|
||||
if (index < pid_size - 1) {
|
||||
size_t os = pid_size - index - 1;
|
||||
memmove((void *)(pid_data + pid_start + index + 1), (const void *)(pid_data + pid_start + index), os * sizeof(T));
|
||||
const size_t os = pid_size - index - 1;
|
||||
memmove(reinterpret_cast<void *>(pid_data + pid_start + index + 1),
|
||||
reinterpret_cast<const void *>(pid_data + pid_start + index),
|
||||
os * sizeof(T));
|
||||
}
|
||||
} else {
|
||||
alloc_backward(pid_size + 1, -1);
|
||||
if (index > 0) {
|
||||
memmove((void *)(pid_data + pid_start), (const void *)(pid_data + pid_start + 1), index * sizeof(T));
|
||||
memmove(reinterpret_cast<void *>(pid_data + pid_start),
|
||||
reinterpret_cast<const void *>(pid_data + pid_start + 1),
|
||||
index * sizeof(T));
|
||||
}
|
||||
}
|
||||
elementNew(pid_data + pid_start + index, std::move(e));
|
||||
@@ -1379,17 +1387,21 @@ public:
|
||||
}
|
||||
#endif
|
||||
assert(&v != this);
|
||||
bool dir = v.size() > pid_size ? true : (index >= pid_rsize / 2 ? true : false);
|
||||
const bool dir = v.size() > pid_size ? true : (index >= pid_rsize / 2 ? true : false);
|
||||
if (dir) {
|
||||
ssize_t os = pid_size - index;
|
||||
const ssize_t os = pid_size - index;
|
||||
alloc_forward(pid_size + v.pid_size);
|
||||
if (os > 0) {
|
||||
memmove((void *)(pid_data + pid_start + index + v.pid_size), (const void *)(pid_data + pid_start + index), os * sizeof(T));
|
||||
memmove(reinterpret_cast<void *>(pid_data + pid_start + index + v.pid_size),
|
||||
reinterpret_cast<const void *>(pid_data + pid_start + index),
|
||||
os * sizeof(T));
|
||||
}
|
||||
} else {
|
||||
alloc_backward(pid_size + v.pid_size, -v.pid_size);
|
||||
if (index > 0) {
|
||||
memmove((void *)(pid_data + pid_start), (const void *)(pid_data + pid_start + v.pid_size), index * sizeof(T));
|
||||
memmove(reinterpret_cast<void *>(pid_data + pid_start),
|
||||
reinterpret_cast<const void *>(pid_data + pid_start + v.pid_size),
|
||||
index * sizeof(T));
|
||||
}
|
||||
}
|
||||
newT(pid_data + pid_start + index, v.pid_data + v.pid_start, v.pid_size);
|
||||
@@ -1408,19 +1420,21 @@ public:
|
||||
//! \~\sa \a append(), \a prepend(), \a remove()
|
||||
inline PIDeque<T> & insert(size_t index, std::initializer_list<T> init_list) {
|
||||
if (init_list.size() == 0) return *this;
|
||||
bool dir = init_list.size() > pid_size ? true : (index >= pid_rsize / 2 ? true : false);
|
||||
const bool dir = init_list.size() > pid_size ? true : (index >= pid_rsize / 2 ? true : false);
|
||||
if (dir) {
|
||||
ssize_t os = ssize_t(pid_size) - index;
|
||||
const ssize_t os = ssize_t(pid_size) - index;
|
||||
alloc_forward(pid_size + init_list.size());
|
||||
if (os > 0) {
|
||||
memmove((void *)(pid_data + pid_start + index + init_list.size()),
|
||||
(const void *)(pid_data + pid_start + index),
|
||||
memmove(reinterpret_cast<void *>(pid_data + pid_start + index + init_list.size()),
|
||||
reinterpret_cast<const void *>(pid_data + pid_start + index),
|
||||
os * sizeof(T));
|
||||
}
|
||||
} else {
|
||||
alloc_backward(pid_size + init_list.size(), -init_list.size());
|
||||
if (index > 0) {
|
||||
memmove((void *)(pid_data + pid_start), (const void *)(pid_data + pid_start + init_list.size()), index * sizeof(T));
|
||||
memmove(reinterpret_cast<void *>(pid_data + pid_start),
|
||||
reinterpret_cast<const void *>(pid_data + pid_start + init_list.size()),
|
||||
index * sizeof(T));
|
||||
}
|
||||
}
|
||||
newT(pid_data + pid_start + index, init_list.begin(), init_list.size());
|
||||
@@ -1444,13 +1458,17 @@ public:
|
||||
pid_size = index;
|
||||
}
|
||||
} else {
|
||||
size_t os = pid_size - index - count;
|
||||
const size_t os = pid_size - index - count;
|
||||
deleteT(pid_data + pid_start + index, count);
|
||||
if (os <= index) {
|
||||
memmove((void *)(pid_data + pid_start + index), (const void *)(pid_data + pid_start + index + count), os * sizeof(T));
|
||||
memmove(reinterpret_cast<void *>(pid_data + pid_start + index),
|
||||
reinterpret_cast<const void *>(pid_data + pid_start + index + count),
|
||||
os * sizeof(T));
|
||||
} else {
|
||||
if (index > 0) {
|
||||
memmove((void *)(pid_data + pid_start + count), (const void *)(pid_data + pid_start), index * sizeof(T));
|
||||
memmove(reinterpret_cast<void *>(pid_data + pid_start + count),
|
||||
reinterpret_cast<const void *>(pid_data + pid_start),
|
||||
index * sizeof(T));
|
||||
}
|
||||
pid_start += count;
|
||||
}
|
||||
@@ -1544,7 +1562,7 @@ public:
|
||||
//! \endcode
|
||||
//! \~\sa \a reversed()
|
||||
inline PIDeque<T> & reverse() {
|
||||
size_t s2 = pid_size / 2;
|
||||
const size_t s2 = pid_size / 2;
|
||||
for (size_t i = 0; i < s2; ++i) {
|
||||
piSwap<T>(pid_data[pid_start + i], pid_data[pid_start + pid_size - i - 1]);
|
||||
}
|
||||
@@ -1575,7 +1593,7 @@ public:
|
||||
//! Если `add_size < 0` и в массиве меньше элементов чем указано, то массив становится пустым.
|
||||
//! \~\sa \a resize()
|
||||
inline PIDeque<T> & enlarge(ssize_t add_size, const T & e = T()) {
|
||||
ssize_t ns = size_s() + add_size;
|
||||
const ssize_t ns = size_s() + add_size;
|
||||
if (ns <= 0)
|
||||
clear();
|
||||
else
|
||||
@@ -1698,7 +1716,7 @@ public:
|
||||
//! \~\sa \a push_back()
|
||||
inline PIDeque<T> & push_back(std::initializer_list<T> init_list) {
|
||||
if (init_list.size() == 0) return *this;
|
||||
size_t ps = pid_size;
|
||||
const size_t ps = pid_size;
|
||||
alloc_forward(pid_size + init_list.size());
|
||||
newT(pid_data + pid_start + ps, init_list.begin(), init_list.size());
|
||||
return *this;
|
||||
@@ -1718,7 +1736,7 @@ public:
|
||||
}
|
||||
#endif
|
||||
assert(&v != this);
|
||||
size_t ps = pid_size;
|
||||
const size_t ps = pid_size;
|
||||
alloc_forward(pid_size + v.pid_size);
|
||||
newT(pid_data + ps + pid_start, v.pid_data + v.pid_start, v.pid_size);
|
||||
return *this;
|
||||
@@ -1997,7 +2015,7 @@ public:
|
||||
//! \endcode
|
||||
//! \~\sa \a take_front(), \a pop_back(), \a pop_front()
|
||||
inline T take_back() {
|
||||
T e(back());
|
||||
const T e(back());
|
||||
pop_back();
|
||||
return e;
|
||||
}
|
||||
@@ -2012,7 +2030,7 @@ public:
|
||||
//! \endcode
|
||||
//! \~\sa \a take_front(), \a pop_back(), \a pop_front()
|
||||
inline T take_front() {
|
||||
T e(front());
|
||||
const T e(front());
|
||||
pop_front();
|
||||
return e;
|
||||
}
|
||||
@@ -2415,8 +2433,8 @@ public:
|
||||
inline PIDeque<C> flatten(ReshapeOrder order = ReshapeByRow) const {
|
||||
PIDeque<C> ret;
|
||||
if (isEmpty()) return ret;
|
||||
size_t rows = size();
|
||||
size_t cols = at(0).size();
|
||||
const size_t rows = size();
|
||||
const size_t cols = at(0).size();
|
||||
ret.reserve(rows * cols);
|
||||
if (order == ReshapeByRow) {
|
||||
for (size_t r = 0; r < rows; r++) {
|
||||
@@ -2487,11 +2505,11 @@ public:
|
||||
inline PIDeque<PIDeque<T>> splitBySize(size_t sz) const {
|
||||
PIDeque<PIDeque<T>> ret;
|
||||
if (isEmpty() || sz == 0) return ret;
|
||||
size_t ch = pid_size / sz;
|
||||
const size_t ch = pid_size / sz;
|
||||
for (size_t i = 0; i < ch; ++i) {
|
||||
ret << PIDeque<T>(pid_data + pid_start + sz * i, sz);
|
||||
}
|
||||
size_t t = ch * sz;
|
||||
const size_t t = ch * sz;
|
||||
if (t < pid_size) {
|
||||
ret << PIDeque<T>(pid_data + pid_start + t, pid_size - t);
|
||||
}
|
||||
@@ -2520,16 +2538,22 @@ public:
|
||||
if (index >= pid_size || count == 0) return ret;
|
||||
if (index + count > pid_size) count = pid_size - index;
|
||||
ret.alloc_forward(count);
|
||||
memcpy((void *)(ret.pid_data + ret.pid_start), (const void *)(pid_data + pid_start + index), count * sizeof(T));
|
||||
memcpy(reinterpret_cast<void *>(ret.pid_data + ret.pid_start),
|
||||
reinterpret_cast<const void *>(pid_data + pid_start + index),
|
||||
count * sizeof(T));
|
||||
|
||||
size_t os = pid_size - index - count;
|
||||
const size_t os = pid_size - index - count;
|
||||
if (os <= index) {
|
||||
if (os > 0) {
|
||||
memmove((void *)(pid_data + pid_start + index), (const void *)(pid_data + pid_start + index + count), os * sizeof(T));
|
||||
memmove(reinterpret_cast<void *>(pid_data + pid_start + index),
|
||||
reinterpret_cast<const void *>(pid_data + pid_start + index + count),
|
||||
os * sizeof(T));
|
||||
}
|
||||
} else {
|
||||
if (index > 0) {
|
||||
memmove((void *)(pid_data + pid_start + count), (const void *)(pid_data + pid_start), index * sizeof(T));
|
||||
memmove(reinterpret_cast<void *>(pid_data + pid_start + count),
|
||||
reinterpret_cast<const void *>(pid_data + pid_start),
|
||||
index * sizeof(T));
|
||||
}
|
||||
pid_start += count;
|
||||
}
|
||||
@@ -2550,10 +2574,11 @@ private:
|
||||
if (pid_rsize * 2 >= size_t(s) && pid_rsize < size_t(s)) {
|
||||
return pid_rsize * 2;
|
||||
}
|
||||
size_t t = _PIContainerConstants<T>::minCountPoT();
|
||||
size_t s_ = s - 1;
|
||||
while (s_ >> t)
|
||||
size_t t = _PIContainerConstants<T>::minCountPoT();
|
||||
s -= 1;
|
||||
while (s >> t) {
|
||||
++t;
|
||||
}
|
||||
return (1 << t);
|
||||
}
|
||||
|
||||
@@ -2568,7 +2593,7 @@ private:
|
||||
template<typename T1 = T, typename std::enable_if<std::is_trivially_copyable<T1>::value, int>::type = 0>
|
||||
inline void newT(T * dst, const T * src, size_t s) {
|
||||
PIINTROSPECTION_CONTAINER_USED(T, s)
|
||||
memcpy((void *)(dst), (const void *)(src), s * sizeof(T));
|
||||
memcpy(reinterpret_cast<void *>(dst), reinterpret_cast<const void *>(src), s * sizeof(T));
|
||||
}
|
||||
|
||||
template<typename T1 = T, typename std::enable_if<!std::is_trivially_copyable<T1>::value, int>::type = 0>
|
||||
@@ -2616,7 +2641,7 @@ private:
|
||||
|
||||
inline void dealloc() {
|
||||
if (pid_data != nullptr) {
|
||||
free((void *)pid_data);
|
||||
free(reinterpret_cast<void *>(pid_data));
|
||||
pid_data = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -2627,15 +2652,19 @@ private:
|
||||
if (pid_start < (pid_size * 2) || ssize_t(pid_start) > (ssize_t(pid_rsize) - (ssize_t(pid_size) * 2))) {
|
||||
size_t ns = (pid_rsize - pid_size) / 2;
|
||||
if (pid_start != ns) {
|
||||
memmove((void *)(pid_data + ns), (const void *)(pid_data + pid_start), pid_size * sizeof(T));
|
||||
memmove(reinterpret_cast<void *>(pid_data + ns),
|
||||
reinterpret_cast<const void *>(pid_data + pid_start),
|
||||
pid_size * sizeof(T));
|
||||
pid_start = ns;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
size_t ns = (pid_rsize - pid_size) / 2;
|
||||
const size_t ns = (pid_rsize - pid_size) / 2;
|
||||
if (pid_start != ns) {
|
||||
memmove((void *)(pid_data + ns), (const void *)(pid_data + pid_start), pid_size * sizeof(T));
|
||||
memmove(reinterpret_cast<void *>(pid_data + ns),
|
||||
reinterpret_cast<const void *>(pid_data + pid_start),
|
||||
pid_size * sizeof(T));
|
||||
pid_start = ns;
|
||||
}
|
||||
}
|
||||
@@ -2647,11 +2676,11 @@ private:
|
||||
if (pid_start > 0) checkMove();
|
||||
return;
|
||||
}
|
||||
pid_size = new_size;
|
||||
size_t as = asize(pid_start + new_size);
|
||||
pid_size = new_size;
|
||||
const size_t as = asize(pid_start + new_size);
|
||||
if (as != pid_rsize) {
|
||||
PIINTROSPECTION_CONTAINER_ALLOC(T, (as - pid_rsize))
|
||||
T * p_d = (T *)(realloc((void *)(pid_data), as * sizeof(T)));
|
||||
T * p_d = reinterpret_cast<T *>(realloc(reinterpret_cast<void *>(pid_data), as * sizeof(T)));
|
||||
#ifndef NDEBUG
|
||||
if (!p_d) {
|
||||
printf("error with PIDeque<%s>::alloc\n", __PIP_TYPENAME__(T));
|
||||
@@ -2664,18 +2693,13 @@ private:
|
||||
}
|
||||
|
||||
inline void alloc_backward(size_t new_size, ssize_t start_offset = 0) {
|
||||
size_t as;
|
||||
if (ssize_t(pid_start) + start_offset < 0) {
|
||||
as = asize(pid_rsize - start_offset);
|
||||
} else {
|
||||
as = pid_rsize;
|
||||
}
|
||||
const size_t as = ssize_t(pid_start) + start_offset < 0 ? asize(pid_rsize - start_offset) : pid_rsize;
|
||||
if (as > pid_rsize) {
|
||||
T * td = (T *)(malloc(as * sizeof(T)));
|
||||
size_t ns = pid_start + as - pid_rsize;
|
||||
T * td = reinterpret_cast<T *>(malloc(as * sizeof(T)));
|
||||
const size_t ns = pid_start + as - pid_rsize;
|
||||
PIINTROSPECTION_CONTAINER_ALLOC(T, (as - pid_rsize))
|
||||
if (pid_rsize > 0 && pid_data != 0) {
|
||||
memcpy((void *)(td + ns), (const void *)(pid_data + pid_start), pid_size * sizeof(T));
|
||||
memcpy(reinterpret_cast<void *>(td + ns), reinterpret_cast<const void *>(pid_data + pid_start), pid_size * sizeof(T));
|
||||
dealloc();
|
||||
}
|
||||
pid_data = td;
|
||||
@@ -2688,7 +2712,7 @@ private:
|
||||
}
|
||||
|
||||
inline void expand(size_t new_size, const T & e = T()) {
|
||||
size_t os = pid_size;
|
||||
const size_t os = pid_size;
|
||||
alloc_forward(new_size);
|
||||
PIINTROSPECTION_CONTAINER_USED(T, (new_size - os))
|
||||
for (size_t i = os + pid_start; i < new_size + pid_start; ++i) {
|
||||
@@ -2697,7 +2721,7 @@ private:
|
||||
}
|
||||
|
||||
inline void expand(size_t new_size, std::function<T(size_t i)> f) {
|
||||
size_t os = pid_size;
|
||||
const size_t os = pid_size;
|
||||
alloc_forward(new_size);
|
||||
PIINTROSPECTION_CONTAINER_USED(T, (new_size - os))
|
||||
for (size_t i = os + pid_start; i < new_size + pid_start; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user