Add queries to determine if a node is a list sentinal

This commit is contained in:
Ian Romanick 2010-06-04 16:35:42 -07:00
parent 31881908eb
commit 7c40a32054

16
list.h
View file

@ -140,6 +140,22 @@ struct exec_node {
this->prev->next = before; this->prev->next = before;
this->prev = before; this->prev = before;
} }
/**
* Is this the sentinal at the tail of the list?
*/
bool is_tail_sentinal() const
{
return this->next == NULL;
}
/**
* Is this the sentinal at the head of the list?
*/
bool is_head_sentinal() const
{
return this->prev == NULL;
}
#endif #endif
}; };