diff options
-rw-r--r-- | include/ilist.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/ilist.h b/include/ilist.h index 722677f9057..4b89efe7717 100644 --- a/include/ilist.h +++ b/include/ilist.h @@ -26,8 +26,7 @@ template <class Tag= void> struct ilist_node { ilist_node() #ifndef DBUG_OFF - : - next(NULL), prev(NULL) + : next(NULL), prev(NULL) #endif { } @@ -70,11 +69,12 @@ public: typedef T *pointer; typedef T &reference; - Iterator(ListNode *node) : node_(node) {} + Iterator(ListNode *node) : node_(node) { assert(node_); } Iterator &operator++() { node_= node_->next; + assert(node_); return *this; } Iterator operator++(int) @@ -87,6 +87,7 @@ public: Iterator &operator--() { node_= node_->prev; + assert(node_); return *this; } Iterator operator--(int) |