Vector: Add a clear() method
This commit is contained in:
parent
6f14bf553f
commit
89ad6869a4
@ -160,6 +160,12 @@ template <typename T> class Vector
|
|||||||
return m_size;
|
return m_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clear()
|
||||||
|
{
|
||||||
|
m_size = m_capacity = 0;
|
||||||
|
free_impl(m_data);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T* m_data { nullptr };
|
T* m_data { nullptr };
|
||||||
usize m_capacity { 0 };
|
usize m_capacity { 0 };
|
||||||
|
Loading…
Reference in New Issue
Block a user