mirror of
https://github.com/libretro/scummvm.git
synced 2024-11-30 21:00:39 +00:00
COMMON: Added Common::List::front() and back() method (similar to std::list)
svn-id: r40154
This commit is contained in:
parent
ed87cbab90
commit
84f0e1d986
@ -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) {
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user