+
+ 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;