use static allocator instead
This commit is contained in:
@ -125,6 +125,8 @@ void TestErase()
|
|||||||
|
|
||||||
int main(int argc, char const *argv[])
|
int main(int argc, char const *argv[])
|
||||||
{
|
{
|
||||||
|
std::vector<int> vvv;
|
||||||
|
vvv.pop_back();
|
||||||
TestConstructor();
|
TestConstructor();
|
||||||
TestIterators();
|
TestIterators();
|
||||||
TestAccessingMethod();
|
TestAccessingMethod();
|
||||||
|
@ -16,7 +16,7 @@ namespace sjtu {
|
|||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class vector {
|
class vector {
|
||||||
std::allocator<T> alloc;
|
static std::allocator<T> alloc;
|
||||||
size_t allocated_length;
|
size_t allocated_length;
|
||||||
size_t current_length;
|
size_t current_length;
|
||||||
T *raw_beg, *raw_end;
|
T *raw_beg, *raw_end;
|
||||||
@ -504,6 +504,8 @@ class vector {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
template<typename T>
|
||||||
|
std::allocator<T> vector<T>::alloc;
|
||||||
|
|
||||||
} // namespace sjtu
|
} // namespace sjtu
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user