Listing 4 Non-inline member-function definitions for a type-safe queue of str wrapped around a genq

//
// strq4.cpp - a type-safe wrapper for
// a queue of str wrapped around a genq
//

#include "strq4.h"

void strq::clear()
       {
       void *p;
       while (gq.remove(p))
              delete (str *)p;
       }

int strq::remove(str &e)
       {
       void *p;
       int rv = gq.remove(p);
       if (rv)
              {
              e = *(str *)p;
              delete (str *)p;
              }
       return rv;
       }

// End of File