blob: 77811b895c975fcd15d57c75b89a0bc0aa285a97 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
#ifndef DOUBLY_LINKED_LIST_IMPL_
#define DOUBLY_LINKED_LIST_IMPL_
#include<exception>
template<class T>
class DoublyLinkedList {
private:
struct DLListNode {};
using Node = DLListNode;
Node* head;
Node* tail;
void copy(const DoublyLinkedList<T>& other);
void free();
class Iterator {
private:
Node* current;
Iterator(Node* c) {}
public:
Iterator& operator++() {}
Iterator operator++(int) {}
Iterator& operator--() {}
Iterator operator--(int) {}
const T& operator*() {}
bool operator==(const Iterator& other) const {}
bool operator!=(const Iterator& other) const {}
friend class DoublyLinkedList<T>;
};
public:
DoublyLinkedList();
DoublyLinkedList(const DoublyLinkedList<T>&);
DoublyLinkedList& operator=(const DoublyLinkedList<T>&);
DoublyLinkedList(DoublyLinkedList<T>&&);
DoublyLinkedList& operator=(DoublyLinkedList<T>&&);
void pushBack(const T&);
void popBack();
void pushFront(const T&);
void popFront();
bool empty() const;
const T& back() const;
const T& front() const;
Iterator begin();
Iterator end();
void insert(Iterator at, const T& elem);
~DoublyLinkedList();
};
#endif
|