#include #include "Queue.h" /* This is an idiosyncrasy of g++. g++ does not handle templates elegantly. The best way to deal with them is to set the -fno-implicit-templates and them manually instantiate (i.e., generate the code for) templates that your code uses, using lines similar to the ones below. */ // Include the source code for the Queue class so that the compiler can // compile a version for integers. #include "Queue.cpp" // Now force the compiler to generate code for a Queue of integers from // the Queue template. template class Queue; int main(void) { Queue cue(10); int i; i = 1; while (!cue.isFull()) cue.enqueue(i++); while (!cue.isEmpty()) { cue.dequeue(i); cout << i << '\n'; } return 0; }