mirror of
https://github.com/NoelFB/blah.git
synced 2026-11-10 00:35:14 +08:00
vector assert
This commit is contained in:
1 parent
8d6bd102f5
commit
86bcd17f6a
1 file changed
+4
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user