]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/list.h
Fixed typo.
[wxWidgets.git] / include / wx / list.h
index a2ba1882f4522e5083c54a0f142bb1cc78f47363..8f0c86f27618340bf300f52203f2e864a730fa6c 100644 (file)
@@ -819,9 +819,19 @@ private:
             reference_type operator*() const                                \
                 { return *(pointer_type)m_node->GetDataPtr(); }             \
             ptrop                                                           \
             reference_type operator*() const                                \
                 { return *(pointer_type)m_node->GetDataPtr(); }             \
             ptrop                                                           \
-            itor& operator++() { m_node = m_node->GetNext(); return *this; }\
+            itor& operator++()                                              \
+            {                                                               \
+                wxASSERT_MSG( m_node, wxT("uninitialized iterator") );      \
+                m_node = m_node->GetNext();                                 \
+                return *this;                                               \
+            }                                                               \
             const itor operator++(int)                                      \
             const itor operator++(int)                                      \
-                { itor tmp = *this; m_node = m_node->GetNext(); return tmp; }\
+            {                                                               \
+                itor tmp = *this;                                           \
+                wxASSERT_MSG( m_node, wxT("uninitialized iterator") );      \
+                m_node = m_node->GetNext();                                 \
+                return tmp;                                                 \
+            }                                                               \
             itor& operator--()                                              \
             {                                                               \
                 m_node = m_node ? m_node->GetPrevious() : m_init;           \
             itor& operator--()                                              \
             {                                                               \
                 m_node = m_node ? m_node->GetPrevious() : m_init;           \
@@ -862,9 +872,19 @@ private:
             reference_type operator*() const                                \
                 { return *(pointer_type)m_node->GetDataPtr(); }             \
             ptrop                                                           \
             reference_type operator*() const                                \
                 { return *(pointer_type)m_node->GetDataPtr(); }             \
             ptrop                                                           \
-            itor& operator++() { m_node = m_node->GetNext(); return *this; }\
+            itor& operator++()                                              \
+            {                                                               \
+                wxASSERT_MSG( m_node, wxT("uninitialized iterator") );      \
+                m_node = m_node->GetNext();                                 \
+                return *this;                                               \
+            }                                                               \
             const itor operator++(int)                                      \
             const itor operator++(int)                                      \
-                { itor tmp = *this; m_node = m_node->GetNext(); return tmp; }\
+            {                                                               \
+                itor tmp = *this;                                           \
+                wxASSERT_MSG( m_node, wxT("uninitialized iterator") );      \
+                m_node = m_node->GetNext();                                 \
+                return tmp;                                                 \
+            }                                                               \
             itor& operator--()                                              \
             {                                                               \
                 m_node = m_node ? m_node->GetPrevious() : m_init;           \
             itor& operator--()                                              \
             {                                                               \
                 m_node = m_node ? m_node->GetPrevious() : m_init;           \