#ifndef NODEH #define NODEH #include using namespace std; typedef int value_type; class node { //A node on a doubly-linked list. value_type value; node(const node& another); //deliberately undefined public: node *prev; node *next; node(const value_type& initial_value); ~node() {detach();} friend void link(node *n1, node *n2); void detach() {link(prev, next);} void insert_this_before(node *n); void insert_this_after(node *n); void print() const {cout << value;} operator value_type() const {return value;} //explained in Chapter 3 }; #endif