This commit is contained in:
David Anderson
2004-08-22 17:57:23 +00:00
parent 909460a58f
commit 2e247acdad
3 changed files with 21 additions and 334 deletions

View File

@ -76,7 +76,7 @@ template <class T> class CVector
delete [] m_Data;
}
if (m_Size < size)
m_CurrentSize = size;
m_CurrentUsedSize = size;
m_Data = newData;
m_Size = size;
return true;
@ -90,7 +90,6 @@ protected:
T *m_Data;
size_t m_Size;
size_t m_CurrentUsedSize;
size_t m_CurrentSize;
public:
class iterator
{
@ -331,7 +330,7 @@ public:
{
if (pos > m_CurrentUsedSize)
{
ASSERT(0);
// ASSERT(0);
}
return m_Data[pos];
}
@ -340,7 +339,7 @@ public:
{
if (pos > m_CurrentUsedSize)
{
ASSERT(0);
// ASSERT(0);
}
return m_Data[pos];
}
@ -398,7 +397,7 @@ public:
if (where != m_Data)
--where;
// validate iter
if (where < m_Data || where >= (m_Data + m_CurrentUsedSize))
if (where < m_Data || where >= (m_Data + m_CurrentSize))
return false;
++m_CurrentUsedSize;
@ -416,7 +415,7 @@ public:
void erase(iterator where)
{
// validate iter
if (where < m_Data || where >= (m_Data + m_CurrentUsedSize))
if (where < m_Data || where >= (m_Data + m_CurrentSize))
return false;
if (m_CurrentUsedSize > 1)
@ -438,5 +437,4 @@ public:
}
};
#endif // __CVECTOR_H__
#endif // __CVECTOR_H__