sourcehook/sh_list.h
changeset 111 aec58c99dafc
parent 107 1d6e7e0bdcd9
child 119 8b8ccac34850
     1.1 --- a/sourcehook/sh_list.h	Tue Sep 13 22:16:29 2005 +0000
     1.2 +++ b/sourcehook/sh_list.h	Fri Sep 23 20:14:10 2005 +0000
     1.3 @@ -126,12 +126,22 @@
     1.4  		{
     1.5  			m_This = where.m_This;
     1.6  		}
     1.7 +		//pre decrement
     1.8  		iterator & operator--()
     1.9  		{
    1.10  			if (m_This)
    1.11  				m_This = m_This->prev;
    1.12  			return *this;
    1.13  		}
    1.14 +		//post decrement
    1.15 +		iterator operator--(int)
    1.16 +		{
    1.17 +			iterator old(*this);
    1.18 +			if (m_This)
    1.19 +				m_This = m_This->prev;
    1.20 +			return old;
    1.21 +		}	
    1.22 +		
    1.23  		//pre increment
    1.24  		iterator & operator++()
    1.25  		{
    1.26 @@ -147,7 +157,8 @@
    1.27  				m_This = m_This->next;
    1.28  			return old;
    1.29  		}
    1.30 -		T & operator * () const
    1.31 +		
    1.32 +		const T & operator * () const
    1.33  		{
    1.34  			return m_This->obj;
    1.35  		}
    1.36 @@ -155,10 +166,16 @@
    1.37  		{
    1.38  			return m_This->obj;
    1.39  		}
    1.40 -		T * operator -> () const
    1.41 +		
    1.42 +		T * operator -> ()
    1.43  		{
    1.44  			return &(m_This->obj);
    1.45  		}
    1.46 +		const T * operator -> () const
    1.47 +		{
    1.48 +			return &(m_This->obj);
    1.49 +		}
    1.50 +		
    1.51  		bool operator != (const iterator &where) const
    1.52  		{
    1.53  			return (m_This != where.m_This);
    1.54 @@ -238,6 +255,7 @@
    1.55  	}
    1.56  	List & operator =(List &src)
    1.57  	{
    1.58 +		clear();
    1.59  		iterator iter;
    1.60  		for (iter=src.begin(); iter!=src.end(); iter++)
    1.61  			push_back( (*iter) );