diff --git a/vector/src/vector.hpp b/vector/src/vector.hpp index 692261c..c4d42d0 100644 --- a/vector/src/vector.hpp +++ b/vector/src/vector.hpp @@ -360,14 +360,14 @@ class vector { void clear() { if (raw_beg != nullptr) { for (size_t i = 0; i < current_length; ++i) { - alloc.destroy(raw_beg + i); + std::allocator_traits::destroy(alloc, raw_beg + i); } - current_length = 0; alloc.deallocate(raw_beg, allocated_length); } raw_beg = alloc.allocate(1); raw_end = raw_beg; allocated_length = 1; + current_length = 0; } /** * inserts value before pos