#ifndef CA_UWATERLOO_ALUMNI_DWHARDER_SINGLE_NODE #define CA_UWATERLOO_ALUMNI_DWHARDER_SINGLE_NODE // Author: Douglas Wilhelm Harder // Copyright (c) 2011 by Douglas Wilhelm Harder. All rights reserved. namespace Data_structures { template class Single_list; template class Single_node { private: Type element; Single_node *next_node; public: Single_node( const Type & = Type(), Single_node * = 0 ); Type retrieve() const; Single_node *next() const; friend class Single_list; // if ptr is a pointer to a Single_node object // in one of the friendly classes, you should: // use this -> next_node to modify it // use this -> next() to access it }; template Single_node::Single_node( const Type &e, Single_node *n ):element( e ), next_node( n ) { // empty constructor } template Type Single_node::retrieve() const { return element; } template Single_node *Single_node::next() const { return next_node; } } #endif