Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef LIST_H
- #define LIST_H
- #include <initializer_list>
- #include <string>
- class List {
- private:
- class Node {
- public:
- Node()=default;
- ~Node()=default;
- Node(int v, Node* p, Node* n);
- Node* prev;
- Node* next;
- int value;
- };
- Node *head;
- Node *tail;
- void deleteList (Node *curr);
- public:
- List();
- ~List();
- List(int i);
- List(std::initializer_list<int> l);
- List(List const& rhs);
- List& operator = (List&& rhs);
- List& operator = (List const& rhs);
- void insert (int i);
- void remove (int i);
- int at(unsigned int const index) const;
- int size() const;
- std::string to_string();
- class Smart_Step {
- public:
- Smart_Step()=default;
- ~Smart_Step()=default;
- Smart_Step& operator ++ ();
- bool operator != (int const rhs) const;
- Smart_Step operator = (Smart_Step const& rhs);
- Smart_Step operator * (Smart_Step*);
- Node *pos;
- };
- Smart_Step begin();
- Smart_Step end();
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement