If the list is populated, clear it. Note will not delete objects if the list is of pointers rather than real objects and will therefore be a memory leak.
| Return Type | Function name | Arguments |
|---|---|---|
| hzList<OBJ>& | hzList::operator= | (hzList<OBJ>&,) |
Declared and defined in file: hzTmplList.h
Function Logic:
Function body:
hzList<OBJ>& hzList::operator= (hzList<OBJ>& op)
{
if (mx && mx == op.mx)
return *this ;
if (mx)
{
// If the list is populated, clear it. Note will not delete objects if the list is of pointers rather than real objects and
// will therefore be a memory leak.
if (mx->m_nCopy)
mx->m_nCopy-- ;
else
mx->Clear() ;
}
mx = op.mx ;
if (mx)
mx->m_nCopy++ ;
return *this ;
}