allow one list to be initialized from, and also steal the contents from,

another list
This commit is contained in:
Jeff Hill
2001-06-15 22:18:09 +00:00
parent 28ea1b66a3
commit 535ead1241
+14 -3
View File
@@ -75,6 +75,7 @@ template < class T >
class tsSLList : public tsSLNode < T > {
public:
tsSLList (); // creates an empty list
tsSLList ( tsSLList & );
void insert ( T &item, tsSLNode < T > &itemBefore ); // insert after item before
void add ( T &item ); // add to the beginning of the list
T * get (); // remove from the beginning of the list
@@ -85,8 +86,7 @@ public:
tsSLIterConst <T> firstIter () const;
tsSLIter <T> firstIter ();
private:
tsSLList ( const tsSLList & ); // dissallowed
const tsSLList < T > & operator = ( const tsSLList < T > & ) const;
const tsSLList < T > & operator = ( const tsSLList < T > & );
};
//
@@ -148,7 +148,8 @@ tsSLNode < T > ::tsSLNode () : pNext ( 0 ) {}
// do _not_ change the node pointers
//
template < class T >
inline const tsSLNode < T > & tsSLNode < T >::operator = ( const tsSLNode < T > & ) const
inline const tsSLNode < T > & tsSLNode < T >::operator =
( const tsSLNode < T > & ) const
{
return *this;
}
@@ -183,6 +184,16 @@ inline tsSLList < T > :: tsSLList ()
{
}
//
// tsSLList<T>::tsSLList( tsSLList & )
//
template < class T >
inline tsSLList < T > :: tsSLList ( tsSLList &listIn )
{
this->pNext = listIn.pNext;
listIn.pNext = 0;
}
//
// tsSLList<T>::insert()
// (itemBefore might be the list header object and therefore