Fixed bug in prune()

Synced changes from SourceHook
This commit is contained in:
David Anderson
2005-11-20 20:54:20 +00:00
parent 3324d65f3f
commit 6f2121cd4d
3 changed files with 181 additions and 11 deletions

View File

@ -11,8 +11,8 @@
#ifndef _INCLUDE_SMM_LIST_H
#define _INCLUDE_SMM_LIST_H
#include <new>
#include <malloc.h>
#include <string.h>
//namespace SourceHook
//{
@ -127,12 +127,22 @@ public:
{
m_This = where.m_This;
}
//pre decrement
iterator & operator--()
{
if (m_This)
m_This = m_This->prev;
return *this;
}
//post decrement
iterator operator--(int)
{
iterator old(*this);
if (m_This)
m_This = m_This->prev;
return old;
}
//pre increment
iterator & operator++()
{
@ -148,7 +158,8 @@ public:
m_This = m_This->next;
return old;
}
T & operator * () const
const T & operator * () const
{
return m_This->obj;
}
@ -156,10 +167,16 @@ public:
{
return m_This->obj;
}
T * operator -> () const
T * operator -> ()
{
return &(m_This->obj);
}
const T * operator -> () const
{
return &(m_This->obj);
}
bool operator != (const iterator &where) const
{
return (m_This != where.m_This);
@ -239,6 +256,7 @@ public:
}
List & operator =(List &src)
{
clear();
iterator iter;
for (iter=src.begin(); iter!=src.end(); iter++)
push_back( (*iter) );