From dbfc2880c840193f01ae26c48201a6bf1f2963d3 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 9 May 2002 15:18:56 +0000 Subject: [PATCH] cleaned up assignment and copy operator for node class --- src/libCom/cxxTemplates/tsDLList.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/libCom/cxxTemplates/tsDLList.h b/src/libCom/cxxTemplates/tsDLList.h index d4c866bdf..ea1702f54 100644 --- a/src/libCom/cxxTemplates/tsDLList.h +++ b/src/libCom/cxxTemplates/tsDLList.h @@ -50,7 +50,8 @@ template class tsDLNode { public: tsDLNode (); - tsDLNode operator = ( const tsDLNode & ) const; + tsDLNode ( const tsDLNode & ); + const tsDLNode & operator = ( const tsDLNode & ); private: T *pNext; T *pPrev; @@ -60,7 +61,6 @@ private: friend class tsDLIter; // deprecated friend class tsDLFwdIter; // deprecated friend class tsDLBwdIter; // deprecated - tsDLNode ( const tsDLNode & ); }; // @@ -163,6 +163,10 @@ private: template inline tsDLNode::tsDLNode() : pNext(0), pPrev(0) {} +template +inline tsDLNode::tsDLNode ( const tsDLNode & ) : + pNext (0), pPrev(0) {} + // // tsDLNode::operator = () // @@ -170,9 +174,9 @@ inline tsDLNode::tsDLNode() : pNext(0), pPrev(0) {} // do _not_ change the node pointers // template -inline tsDLNode tsDLNode::operator = (const tsDLNode &) const +inline const tsDLNode & tsDLNode::operator = ( const tsDLNode & ) { - return tsDLNode(); + return * this; } //////////////////////////////////////