Diffstat (limited to 'noncore/apps/opie-reader/my_list.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/my_list.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/my_list.h b/noncore/apps/opie-reader/my_list.h index f180d3d..52e6472 100644 --- a/noncore/apps/opie-reader/my_list.h +++ b/noncore/apps/opie-reader/my_list.h | |||
@@ -3,2 +3,6 @@ | |||
3 | 3 | ||
4 | #ifndef NULL | ||
5 | #define NULL 0 | ||
6 | #endif | ||
7 | |||
4 | template<class T> | 8 | template<class T> |
@@ -32,2 +36,10 @@ class CList | |||
32 | T& last() { return back->data; } | 36 | T& last() { return back->data; } |
37 | T pop() | ||
38 | { | ||
39 | T data = front->data; | ||
40 | node* n = front; | ||
41 | front = front->next; | ||
42 | delete n; | ||
43 | return data; | ||
44 | } | ||
33 | T* operator[](int n) | 45 | T* operator[](int n) |