+ typedef T value_type;
+ typedef value_type* iterator;
+ typedef value_type& reference;
+
+ wxVector() : m_allocsize(16), m_size(0), m_capacity(0), m_objects(0) {}
+
+ wxVector(const wxVector& c)
+ {
+ wxCHECK2(Copy(c), return);
+ }
+
+ ~wxVector()
+ {
+ clear();
+ }
+
+ void clear()
+ {
+ for (size_type i = 0; i < size(); i++)
+ delete m_objects[i];
+ free(m_objects);
+ m_objects = 0;
+ m_size = m_capacity = 0;
+ }
+
+ void reserve(size_type n)
+ {
+ if ( !Alloc(n) )
+ {
+ wxFAIL_MSG( _T("out of memory in wxVector::reserve()") );
+ }
+ }
+
+ size_type size() const
+ {
+ return m_size;
+ }
+
+ size_type capacity() const
+ {
+ return m_capacity;
+ }
+
+ bool empty() const
+ {
+ return size() == 0;
+ }
+
+ wxVector& operator=(const wxVector& vb)
+ {
+ wxCHECK(Copy(vb), *this);
+ return *this;
+ }
+
+ void push_back(const value_type& o)
+ {
+ wxCHECK2(Alloc(size() + 1), return);
+ Append(new value_type(o));
+ }
+
+ void pop_back()
+ {
+ RemoveAt(size() - 1);
+ }
+
+ const value_type& at(size_type idx) const
+ {
+ wxASSERT(idx < m_size);
+ return *m_objects[idx];
+ }
+
+ value_type& at(size_type idx)
+ {
+ wxASSERT(idx < m_size);
+ return *m_objects[idx];
+ }
+
+ const value_type& operator[](size_type idx) const { return at(idx); }
+ value_type& operator[](size_type idx) { return at(idx); }
+ const value_type& front() const { return at(0); }
+ value_type& front() { return at(0); }
+ const value_type& back() const { return at(size() - 1); }
+ value_type& back() { return at(size() - 1); }
+
+ iterator begin() { return m_objects[0]; }
+ iterator end() { return m_objects[size()]; }