Detach the node at a chain offset.
- Parameters
-
- Returns
- the detached i-th node
- Exceptions
-
Definition at line 167 of file chain.hpp.
References likely, csdbg::node< T >::link(), csdbg::node< T >::link_to(), unlikely, and csdbg::node< T >::unlink_from().
170 throw exception(
"offset out of chain bounds (%d >= %d)", i,
m_size);
172 node<T> *cur =
m_head, *prev = NULL, *next;
173 while (
likely(i-- > 0) ) {
174 next = cur->link(prev);
179 next = cur->link(prev);
200 prev->unlink_from(cur);
203 next->unlink_from(cur);
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
node< T > * m_tail
Chain tail.
node< T > * m_head
Chain head.
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.