Changed: Updated to compile under linux

~g2k
This commit is contained in:
2005-06-20 03:03:16 -04:00
parent e2ca6ca672
commit a0b8ce778b
27 changed files with 603 additions and 236 deletions

View File

@@ -37,6 +37,7 @@ public:
void FirstPosition();
void LastPosition();
void Clear();
bool Contains(ItemType) const;
unsigned int Length();
void operator=(const list<ItemType>&);
ItemType operator[](LIST_ARRAY_INDEX_TYPE) const;
@@ -341,7 +342,7 @@ ItemType& list<ItemType>::operator[](LIST_ARRAY_INDEX_TYPE index)
}
template <class ItemType>
unsigned int Length()
unsigned int list<ItemType>::Length()
{
if (head == NULL)
{
@@ -354,10 +355,25 @@ unsigned int Length()
while (temp != NULL)
{
temp = temp->next;
len++
len++;
}
return len;
}
}
template<class ItemType>
bool list<ItemType>::Contains(ItemType value)
{
listNodke<ItemType>* temp = head;
while(temp != NULL)
{
if(temp->data == value)
{
return true;
}
temp = temp->next;
}
return false;
}
#endif