libcsdbg  1.28
C++ exception (and generic) stack trace debug library
template<class T >
stack< T > & csdbg::stack< T >::clear ( )
virtual

Empty the stack.

Returns
*this

Definition at line 310 of file stack.hpp.

References likely, and csdbg::node< T >::m_link.

311 {
312  node<T> *n = m_top;
313  while ( likely(n != NULL) ) {
314  node<T> *tmp = n->m_link;
315  delete n;
316  n = tmp;
317  }
318 
319  m_top = NULL;
320  m_size = 0;
321  return *this;
322 }
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
Definition: config.hpp:344
u32 m_size
Node count.
Definition: stack.hpp:36
node< T > * m_top
Stack top.
Definition: stack.hpp:34