Home Segments Index Top Previous Next

784: Mainline

Next, you must ensure that the iterator member functions have access to the header and link member variables by declaring the iterator class to be a friend of both the header class and the link class:

template 
class link {
  friend class iterator;  
  friend class header;      
  ...
};
template 
class header {
  friend class iterator;       
  ... 
};