Vector: Add a clear() method

This commit is contained in:
apio 2023-03-23 21:20:41 +01:00
parent 6f14bf553f
commit 89ad6869a4
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -160,6 +160,12 @@ template <typename T> class Vector
return m_size;
}
void clear()
{
m_size = m_capacity = 0;
free_impl(m_data);
}
private:
T* m_data { nullptr };
usize m_capacity { 0 };