vector assert

This commit is contained in:
Noel Berry 2020-10-24 17:51:40 -07:00
parent 8d6bd102f5
commit 86bcd17f6a

View File

@ -275,8 +275,11 @@ namespace Blah
template<class T>
void Vector<T>::erase(const T* position)
{
BLAH_ASSERT(m_size > 0, "Index is out of range");
BLAH_ASSERT(position >= begin() && position < end(), "Index is out of range");
if (m_size > 0)
{
const size_t index = position - begin();
if (index < m_size - 1)
@ -303,6 +306,7 @@ namespace Blah
m_size--;
}
}
template<class T>
void Vector<T>::dispose()