// Node.cpp // templated node class for use with linked lists // the header and implementation are combined because of templates #ifndef _NODE_H #define _NODE_H // forward declarations, so Node can make them friends template < class T > class Set; template < class T > class SetIter; template < class T > class Node { private: T info; Node < T > *next; // link to next node public: Node():next(0) { // implicitly calls default constructor for T info } Node(T n, Node * link = 0):info(n), next(link) { } friend class Set < T >; // let Set access private members friend class SetIter < T >; // let SetIter access private members }; // end of class Node definition #endif