Listing 8 Class definitions for a queue of void *using a nested cell type

//
// genq2.h - a generic queue of void *
//           (interface)
//

#include <iostream.h>

class genq
   {
public:
   genq();
   ~genq();
   void append(void *e);
   void print(ostream &os) const;
   void clear();
   int remove(void *&e);
private:
   struct cell
      {
      cell(void *e, cell *p);
      cell *next;
      void *element;
      };
   cell *first, *last;
   };

inline genq::cell::cell(void *e, cell *p)
   : element(e), next(p)
   {
   }

inline genq::genq() first(0), last(0)
   {
   }

inline genq::~genq()
   {
   clear();
   }

// End of File