version 1.1.2.3, 2006/06/30 19:40:54
|
version 1.1.2.6, 2006/06/30 20:07:50
|
|
|
| |
if (_destructor) | if (_destructor) |
{ | { |
// Reset _front, _back, and _size so that if this is called back, |
// Reset _front, _back, and _size in case the destructor calls |
// there will be nothing to delete. |
// a method of List. |
| |
Linkable* front = _front; | Linkable* front = _front; |
Linkable* back = _back; | Linkable* back = _back; |
|
|
{ | { |
PEGASUS_LIST_ASSERT(p->magic == PEGASUS_LINKABLE_MAGIC); | PEGASUS_LIST_ASSERT(p->magic == PEGASUS_LINKABLE_MAGIC); |
Linkable* next = p->next; | Linkable* next = p->next; |
|
p->list = 0; |
_destructor(p); | _destructor(p); |
p = next; | p = next; |
} | } |
|
|
PEGASUS_LIST_ASSERT(elem != 0); | PEGASUS_LIST_ASSERT(elem != 0); |
PEGASUS_LIST_ASSERT(elem->magic == PEGASUS_LINKABLE_MAGIC); | PEGASUS_LIST_ASSERT(elem->magic == PEGASUS_LINKABLE_MAGIC); |
| |
return elem && elem->list == this; |
|
|
|
#if 0 |
|
for (const Linkable* p = _front; p; p = p->next) | for (const Linkable* p = _front; p; p = p->next) |
{ | { |
if (p == elem) | if (p == elem) |
|
|
| |
// Not found! | // Not found! |
return false; | return false; |
#endif |
|
} | } |
| |
Linkable* ListRep::remove_front() | Linkable* ListRep::remove_front() |