Skip to content
Permalink
Browse files
add debug assertion to ilist
  • Loading branch information
kevgs committed Aug 11, 2020
1 parent c96be84 commit 01738d0
Showing 1 changed file with 4 additions and 3 deletions.
@@ -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)

0 comments on commit 01738d0

Please sign in to comment.