Go to the documentation of this file.
14 #ifndef __dLinkListIncluded
15 #define __dLinkListIncluded
40 node(
const T &_obj = T(),
node *_prev =
nullptr,
node *_next =
nullptr)
129 virtual void clear();
130 virtual int length()
const;
131 virtual void insert(
int i,
const T &obj);
132 virtual void remove(
int i);
133 virtual int search(
const T &obj)
const;
134 virtual T
visit(
int i)
const;
135 virtual void traverse()
const =
delete;
177 : head(new
node()), tail(new
node()), currentLength(0)
185 : head(rvalue.head), tail(rvalue.tail), currentLength(rvalue.currentLength)
187 rvalue.tail = rvalue.head =
nullptr;
201 std::swap(head, rvalue.head);
202 std::swap(tail, rvalue.tail);
203 std::swap(currentLength, rvalue.currentLength);
210 return currentLength;
217 for (
int k = 0; k <= i; ++k)
236 node *delp = move(i);
287 return move(i)->data;
308 tail->prev = tail->prev->next =
new node(obj, tail->prev, tail);
314 tail->prev = tail->prev->next =
new node(std::move(obj), tail->prev, tail);
virtual const_iterator begin() const
bool operator==(const const_iterator &rhs) const
virtual const_iterator end() const
virtual T visit(int i) const
void push_back(const T &obj)
virtual int length() const
dLinkList< T > & operator=(dLinkList< T > &&rvalue)
virtual int search(const T &obj) const
dLinkList< T > operator+(const dLinkList< T > &A, const dLinkList< T > &B)
node(T &&_obj, node *_prev=nullptr, node *_next=nullptr)
virtual void traverse() const =delete
const T & operator*() const
const_iterator operator--(int)
const T & operator*() const
virtual void remove(int i)
bool operator!=(const const_iterator &rhs) const
const_iterator & operator--()
node(const T &_obj=T(), node *_prev=nullptr, node *_next=nullptr)
const_iterator & operator++()
virtual void insert(int i, const T &obj)
const_iterator operator++(int)