aboutsummaryrefslogtreecommitdiff
path: root/common/list.h
diff options
context:
space:
mode:
authorMax Horn2009-04-27 11:11:42 +0000
committerMax Horn2009-04-27 11:11:42 +0000
commit84f0e1d986c5b650f3d91e1ef1be4039694e64f6 (patch)
tree40faf58187b72a25d0a106f321e6404d469c290d /common/list.h
parented87cbab9080fa80beddc1edb3b45fdd43443216 (diff)
downloadscummvm-rg350-84f0e1d986c5b650f3d91e1ef1be4039694e64f6.tar.gz
scummvm-rg350-84f0e1d986c5b650f3d91e1ef1be4039694e64f6.tar.bz2
scummvm-rg350-84f0e1d986c5b650f3d91e1ef1be4039694e64f6.zip
COMMON: Added Common::List::front() and back() method (similar to std::list)
svn-id: r40154
Diffstat (limited to 'common/list.h')
-rw-r--r--common/list.h16
1 files changed, 16 insertions, 0 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) {