Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <class T>
- class list
- {
- public:
- class node;
- friend class node;
- private:
- node *first, *last;
- size_t node_count;
- public:
- class node
- {
- friend class list;
- private:
- const list *owner;
- node *Previous, *Next;
- node(const list *owner)
- : Previous(0), Next(0);
- public:
- T Value;
- ~node();
- node * previous();
- node * next();
- };
- list()
- : node_count(0);
- list(const list &source)
- : node_count(0);
- ~list();
- node * first_node() const;
- node * last_node() const;
- size_t count() const;
- node * add_first(T value);
- node * add_last(T value);
- node * insert_before(node *n, T value);
- node * insert_after(node *n, T value);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement