Traverse the chain with a callback for each node.
- Parameters
-
- Returns
- *this
Definition at line 473 of file chain.hpp.
References __D_ASSERT, likely, csdbg::node< T >::link(), csdbg::node< T >::m_data, and unlikely.
477 return const_cast<chain<T>&
> (*this);
480 node<T> *cur =
m_head, *prev = NULL, *next;
481 while (
likely(cur != NULL) ) {
482 pfunc(i++, cur->m_data);
484 next = cur->link(prev);
489 return const_cast<chain<T>&
> (*this);
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
node< T > * m_head
Chain head.
unsigned int u32
32-bit unsigned integer
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
#define __D_ASSERT(x)
Assertion macro.