libcsdbg  1.28
C++ exception (and generic) stack trace debug library
template<class T >
node< T > & csdbg::node< T >::operator= ( const node< T > &  rval)
protectedvirtual

Assignment operator.

Parameters
[in]rvalthe assigned object
Returns
*this
Exceptions
std::bad_alloc
Note
Only the node data are copied

Definition at line 220 of file node.hpp.

References csdbg::node< T >::m_data, and unlikely.

221 {
222  if ( unlikely(this == &rval) )
223  return *this;
224 
225  T *data = rval.m_data;
226  if ( unlikely(data == NULL) ) {
227  delete m_data;
228  m_data = NULL;
229  }
230 
231  else if ( unlikely(m_data == NULL) )
232  m_data = new T(*data);
233 
234  else
235  *m_data = *data;
236 
237  return *this;
238 }
T * m_data
Node data.
Definition: node.hpp:44
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
Definition: config.hpp:349