22 #ifndef COMMON_LIST_INTERN_H 23 #define COMMON_LIST_INTERN_H 25 #include "common/util.h" 29 template<
typename T>
class List;
32 namespace ListInternal {
45 Node(
const T &x) : _data(x) {}
47 template<
class... TArgs>
48 Node(TArgs&&... args) : _data(Common::forward<TArgs>(args)...) {}
73 Self operator++(
int) {
85 Self operator--(
int) {
90 ValueRef operator*()
const {
92 return static_cast<NodePtr
>(_node)->_data;
94 ValuePtr operator->()
const {
95 return &(operator*());
98 bool operator==(
const Self &x)
const {
99 return _node == x._node;
102 bool operator!=(
const Self &x)
const {
103 return _node != x._node;
111 typedef const T & ValueRef;
112 typedef const T * ValuePtr;
123 _node = _node->_next;
127 Self operator++(
int) {
135 _node = _node->_prev;
139 Self operator--(
int) {
144 ValueRef operator*()
const {
146 return static_cast<NodePtr
>(_node)->_data;
148 ValuePtr operator->()
const {
149 return &(operator*());
152 bool operator==(
const Self &x)
const {
153 return _node == x._node;
156 bool operator!=(
const Self &x)
const {
157 return _node != x._node;
164 return a._node == b._node;
169 return a._node != b._node;
Definition: list_intern.h:33
Definition: algorithm.h:29
Out move(In first, In last, Out dst)
Definition: algorithm.h:109
Definition: list_intern.h:51
Definition: list_intern.h:54
Definition: list_intern.h:42