MCPcopy Create free account
hub / github.com/EricPengShuai/Interview / ~Vector

Method ~Vector

base_code/template.cpp:170–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168 }
169
170 ~Vector()
171 {
172 // 析构容器的有效元素,然后释放 _first 指针指向的堆内存
173 for (T *p = _first; p != _last; ++ p)
174 {
175 _allocator.destroy(p); // 把 _first 指针指向的数组的有效元素进行析构
176 }
177 _allocator.deallocate(_first); // 释放堆上的数组内存
178 _first = _last = _end = nullptr;
179 }
180
181 Vector(const Vector<T> &rhs)
182 {

Callers

nothing calls this directly

Calls 2

destroyMethod · 0.80
deallocateMethod · 0.80

Tested by

no test coverage detected