Commit 01738d08 authored by Eugene Kosov's avatar Eugene Kosov

add debug assertion to ilist

parent c96be848
......@@ -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 @@ template <class T, class Tag= void> class ilist
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 @@ template <class T, class Tag= void> class ilist
Iterator &operator--()
{
node_= node_->prev;
assert(node_);
return *this;
}
Iterator operator--(int)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment