aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/list.h16
-rw-r--r--common/queue.h8
2 files changed, 20 insertions, 4 deletions
diff --git a/common/list.h b/common/list.h
index b2ad3fbc18..1685843e8e 100644
--- a/common/list.h
+++ b/common/list.h
@@ -132,6 +132,22 @@ public:
i = erase(i);
}
+ t_T &front() {
+ return static_cast<Node *>(_anchor._next)->_data;
+ }
+
+ const t_T &front() const {
+ return static_cast<Node *>(_anchor._next)->_data;
+ }
+
+ t_T &back() {
+ return static_cast<Node *>(_anchor._prev)->_data;
+ }
+
+ const t_T &back() const {
+ return static_cast<Node *>(_anchor._prev)->_data;
+ }
+
List<t_T> &operator=(const List<t_T> &list) {
if (this != &list) {
diff --git a/common/queue.h b/common/queue.h
index cfe7f4e596..df8dcfe04c 100644
--- a/common/queue.h
+++ b/common/queue.h
@@ -55,19 +55,19 @@ public:
}
T &front() {
- return *_impl.begin();
+ return _impl.front();
}
const T &front() const {
- return *_impl.begin();
+ return _impl.front();
}
T &back() {
- return *_impl.reverse_begin();
+ return _impl.back();
}
const T &back() const {
- return *_impl.reverse_begin();
+ return _impl.back();
}
T pop() {