Match CScriptSpecialFunction constructor

Former-commit-id: f16397257b
This commit is contained in:
2022-10-02 17:45:14 -04:00
parent 5d42957243
commit f04048e917
8 changed files with 79 additions and 43 deletions

View File

@@ -70,6 +70,7 @@ public:
}
void reserve(int size);
void resize(int size, const T& in);
iterator erase(iterator it);
void push_back(const T& in) {
@@ -118,6 +119,19 @@ public:
inline const T& operator[](int idx) const { return xc_items[idx]; }
};
template < typename T, typename Alloc >
void vector< T, Alloc >::resize(int size, const T& in) {
if (x4_count != size) {
if (size > x4_count) {
reserve(size);
uninitialized_fill_n(xc_items + x4_count, size - x4_count, in);
} else {
destroy(begin() + size, end());
}
x4_count = size;
}
}
template < typename T, typename Alloc >
void vector< T, Alloc >::reserve(int size) {
if (size <= x8_capacity)