X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1f32f5856595dcf584e7a4f2c6617268eabc7520..47fe7ff3821c632b490b16da6b5113f127905a23:/include/wx/vector.h diff --git a/include/wx/vector.h b/include/wx/vector.h index 38a8f90630..f8aa5625eb 100644 --- a/include/wx/vector.h +++ b/include/wx/vector.h @@ -48,7 +48,7 @@ protected: const void *GetItem(size_type idx) const { - wxASSERT(idx >= 0 && idx < m_size); + wxASSERT(idx < m_size); return m_objects[idx]; } @@ -61,7 +61,7 @@ protected: void RemoveAt(size_type idx) { - wxASSERT(idx >= 0 && idx < m_size); + wxASSERT(idx < m_size); Free(m_objects[idx]); if (idx < m_size - 1) memcpy( @@ -132,7 +132,7 @@ public: }; #define WX_DECLARE_VECTORBASE(obj, cls)\ -private:\ +protected:\ virtual void Free(void *o)\ {\ delete (obj *) o;\ @@ -143,7 +143,7 @@ private:\ }\ public:\ cls() {}\ - cls(const cls& c)\ + cls(const cls& c) : wxVectorBase()\ {\ wxCHECK2(copy(c), return);\ }\ @@ -155,7 +155,7 @@ public:\ #define _WX_DECLARE_VECTOR(obj, cls, exp)\ class exp cls : public wxVectorBase\ {\ - WX_DECLARE_VECTORBASE(obj, cls);\ + WX_DECLARE_VECTORBASE(obj, cls)\ public:\ void push_back(const obj& o)\ {\