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 7 by Douglas Thrift, 2004-05-14T00:13:01-07:00 vs.
Revision 8 by Douglas Thrift, 2004-05-14T11:26:01-07:00

# Line 18 | Line 18 | private:
18          NullNode<Type> back;
19   public:
20          DoublyLinkedList() { front.setNext(&back); back.setPrevious(&front); }
21 <        ~DoublyLinkedList();
21 >        ~DoublyLinkedList() { while (front.getNext() != &back) front.removeNext(); }
22          void addFront(const Type& value) { front.addNext(value); }
23          void addBack(const Type& value) { back.addPrevious(value); }
24          bool contains(const Type& value) { return front.contains(value, &back); }
# Line 27 | Line 27 | public:
27          Iterator<Type> iterator(void) { return Iterator<Type>(&front, &back); }
28   };
29  
30 template<typename Type>
31 DoublyLinkedList<Type>::~DoublyLinkedList()
32 {
33        while (front.getNext() != &back) front.removeNext();
34 }
35
30   #endif // _DoublyLinkedList_hpp_

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines