Listing 3 A member function, clear, that discards all the elements in a queue that has elements of type T

// destroy all in the elements in a queue

void Tq::clear()
   {
   cell *p;
   while (first != 0)
      {
      p = first;
      first = first->next;
      delete p;
      }
   }

/* End of File */