mirror of
https://github.com/NoelFB/blah.git
synced 2025-02-21 13:58:28 +08:00
vector assert
This commit is contained in:
parent
8d6bd102f5
commit
86bcd17f6a
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user