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