Advertisement
Guest User

List.h

a guest
Feb 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.09 KB | None | 0 0
  1. #ifndef LIST_H
  2. #define LIST_H
  3. #include <initializer_list>
  4. #include <string>
  5.  
  6. class List {
  7. private:
  8.     class Node {
  9.     public:
  10.         Node()=default;
  11.         ~Node()=default;
  12.         Node(int v, Node* p, Node* n);        
  13.         Node* prev;
  14.         Node* next;  
  15.         int value;  
  16.     };
  17.     Node *head;
  18.     Node *tail;
  19.     void deleteList (Node *curr);
  20.  
  21. public:
  22.     List();
  23.     ~List();
  24.     List(int i);
  25.     List(std::initializer_list<int> l);
  26.     List(List const& rhs);  
  27.     List& operator = (List&& rhs);
  28.     List& operator = (List const& rhs);
  29.     void insert (int i);
  30.     void remove (int i);
  31.     int at(unsigned int const index) const;
  32.     int size() const;
  33.     std::string to_string();
  34.    
  35.     class Smart_Step {
  36.     public:
  37.         Smart_Step()=default;
  38.         ~Smart_Step()=default;
  39.         Smart_Step& operator ++ ();
  40.         bool operator != (int const rhs) const;
  41.         Smart_Step operator = (Smart_Step const& rhs);
  42.         Smart_Step operator * (Smart_Step*);
  43.         Node *pos;
  44.     };
  45.  
  46.     Smart_Step begin();
  47.     Smart_Step end();
  48.  
  49. };
  50. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement