+ typedef const value_type& const_reference;
+
+ class reverse_iterator
+ {
+ public:
+ reverse_iterator() : m_ptr(NULL) { }
+ wxEXPLICIT reverse_iterator(iterator it) : m_ptr(it) { }
+ reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { }
+
+ reference operator*() const { return *m_ptr; }
+ pointer operator->() const { return m_ptr; }
+
+ iterator base() const { return m_ptr; }
+
+ reverse_iterator& operator++()
+ { --m_ptr; return *this; }
+ reverse_iterator operator++(int)
+ { reverse_iterator tmp = *this; --m_ptr; return tmp; }
+ reverse_iterator& operator--()
+ { ++m_ptr; return *this; }
+ reverse_iterator operator--(int)
+ { reverse_iterator tmp = *this; ++m_ptr; return tmp; }
+
+ reverse_iterator operator+(difference_type n) const
+ { return reverse_iterator(m_ptr - n); }
+ reverse_iterator& operator+=(difference_type n)
+ { m_ptr -= n; return *this; }
+ reverse_iterator operator-(difference_type n) const
+ { return reverse_iterator(m_ptr + n); }
+ reverse_iterator& operator-=(difference_type n)
+ { m_ptr += n; return *this; }
+
+ reference operator[](difference_type n) const
+ { return *(*this + n); }
+
+ bool operator ==(const reverse_iterator& it) const
+ { return m_ptr == it.m_ptr; }
+ bool operator !=(const reverse_iterator& it) const
+ { return m_ptr != it.m_ptr; }
+
+ private:
+ value_type *m_ptr;
+
+ friend class const_reverse_iterator;
+ };
+
+ class const_reverse_iterator
+ {
+ public:
+ const_reverse_iterator() : m_ptr(NULL) { }
+ wxEXPLICIT const_reverse_iterator(const_iterator it) : m_ptr(it) { }
+ const_reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { }
+ const_reverse_iterator(const const_reverse_iterator& it) : m_ptr(it.m_ptr) { }
+
+ const_reference operator*() const { return *m_ptr; }
+ const_pointer operator->() const { return m_ptr; }
+
+ const_iterator base() const { return m_ptr; }
+
+ const_reverse_iterator& operator++()
+ { --m_ptr; return *this; }
+ const_reverse_iterator operator++(int)
+ { const_reverse_iterator tmp = *this; --m_ptr; return tmp; }
+ const_reverse_iterator& operator--()
+ { ++m_ptr; return *this; }
+ const_reverse_iterator operator--(int)
+ { const_reverse_iterator tmp = *this; ++m_ptr; return tmp; }
+
+ const_reverse_iterator operator+(difference_type n) const
+ { return const_reverse_iterator(m_ptr - n); }
+ const_reverse_iterator& operator+=(difference_type n)
+ { m_ptr -= n; return *this; }
+ const_reverse_iterator operator-(difference_type n) const
+ { return const_reverse_iterator(m_ptr + n); }
+ const_reverse_iterator& operator-=(difference_type n)
+ { m_ptr += n; return *this; }
+
+ const_reference operator[](difference_type n) const
+ { return *(*this + n); }
+
+ bool operator ==(const const_reverse_iterator& it) const
+ { return m_ptr == it.m_ptr; }
+ bool operator !=(const const_reverse_iterator& it) const
+ { return m_ptr != it.m_ptr; }
+
+ protected:
+ const value_type *m_ptr;
+ };