and a managed vector with a couple of variables in a little wrapper is all you need for a circular one. If you use the % operator you never need to do all that conditional stuff.
basically every increment becomes rear = (rear+1)%size; and it automatically loops around the circle.
by using a vector, which is already templated, you can insert cars too.
line 16 goes away, its a vector<T> now (T being the standard letter for template types but you can use anything). All your element handlers need to become a T as well.
If being circular is unimportant, skip all that and use the stl queue or other container of your choice (vectors can work like an enhanced stack/queue with full access rights to all elements instead of locked out, not sure if that is useful in your situation or not, sometimes it is).
Essentially, you declare your Queue as a templated Queue:
1 2
template <typename T>
class Queue<T>{};
Then everywhere you have an int where you want any type(T), you replace the int with T.
Then when you create the Queue, you give it the type you want to use (the compiler enforces this):