From af1242415ca5754c752471910f461e90f597882f Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Thu, 6 May 2004 19:18:55 +0000 Subject: [PATCH] added iterator() constructor --- amxmodx/CVector.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/amxmodx/CVector.h b/amxmodx/CVector.h index f725859c..627e24f1 100755 --- a/amxmodx/CVector.h +++ b/amxmodx/CVector.h @@ -97,6 +97,11 @@ public: T *m_Ptr; public: // constructors / destructors + iterator() + { + m_Ptr = NULL; + } + iterator(T * ptr) { m_Ptr = ptr; @@ -273,6 +278,13 @@ public: return iterator(m_Data + m_CurrentUsedSize); } + iterator iterAt(size_t pos) + { + if (pos > m_CurrentUsedSize) + ASSERT(0); + return iterator(m_Data + pos); + } + bool reserve(size_t newSize) { return ChangeSize(newSize); @@ -296,6 +308,7 @@ public: --m_CurrentUsedSize; if (m_CurrentUsedSize < 0) m_CurrentUsedSize = 0; + // :TODO: free memory sometimes } bool resize(size_t newSize) @@ -410,7 +423,7 @@ public: } --m_CurrentUsedSize; - FreeMemIfPossible(); + // :TODO: free memory sometimes } void clear()