ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/ccscs20/DoublyLinkedList.hpp
(Generate patch)

Comparing DoublyLinkedList.hpp (file contents):
Revision 2 by Douglas Thrift, 2004-05-12T23:40:15-07:00 vs.
Revision 3 by Douglas Thrift, 2004-05-13T00:24:51-07:00

# Line 14 | Line 14 | template<typename Type>
14   class DoublyLinkedList
15   {
16   private:
17 <        NullNode<Type>* front;
18 <        NullNode<Type>* back;
17 >        NullNode<Type> front;
18 >        NullNode<Type> back;
19   public:
20 <        DoublyLinkedList() {}
21 <        ~DoublyLinkedList() {}
20 >        DoublyLinkedList() { front.setNext(&back); back.setPrevious(&front); }
21 >        ~DoublyLinkedList();
22          void addFront(Type& type);
23          void addBack(Type& type);
24   };
25  
26 + template<typename Type>
27 + DoublyLinkedList<Type>::~DoublyLinkedList()
28 + {
29 +        while (front.getNext() != &back) front.removeNext();
30 + }
31 +
32   #endif // _DoublyLinkedList_hpp_

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines