Similarly, whenever a reference to the link
class appears
inside the definition of the header
class, you must provide an
argument inside brackets. Again, in the railroad-carlist example,
header_parameter
is destined to be replaced by railroad_car
:
templateclass header { public: header ( ) { first_link_pointer = NULL; current_link_pointer = first_link_pointer; } void add (header_parameter *new_element) { first_link_pointer = new link (new_element, first_link_pointer); current_link_pointer = first_link_pointer; } void advance ( ) { current_link_pointer = current_link_pointer -> next_link_pointer; } header_parameter* access ( ) { return current_link_pointer -> element_pointer; } int endp ( ) { return ! current_link_pointer; } void reset ( ) { current_link_pointer = first_link_pointer; } private: link *first_link_pointer; link *current_link_pointer; };