Basic Queue in C++ Using Array I wrote a queue class in C++ using arrays of fixed width. Could anyone review my code ? I would appreciate any comment and recommendations. It works like a circular queue, so I handled back and front pointers in that manner.

#include &lt;stdlib.h&gt;
#include &lt;iostream&gt;

template &lt;class T&gt;
class Queue {
    public:
        Queue(void);
        Queue(Queue&lt;T&gt;&amp; copyQueue);
        bool empty(void) const;
        std::size_t size(void) const;
        void clear(void);
        T front(void) const;
        void pop(void);
        void push(T&amp; item);
        void print(std::ostream&amp; os);
    private:
        static const std::size_t MAX_SIZE = 50;
        T list[MAX_SIZE];
        T* frontPtr;
        T* backPtr;
        std::size_t sizeQ;
};

template &lt;class T&gt;
Queue&lt;T&gt;::Queue(void) {
    frontPtr = nullptr;
    backPtr = nullptr;
    sizeQ = 0;
}

template &lt;class T&gt;
Queue&lt;T&gt;::Queue(Queue&lt;T&gt;&amp; copyQueue) {
    frontPtr = nullptr;
    backPtr = nullptr;
    sizeQ = 0;
    if(copyQueue.backPtr &gt;= copyQueue.frontPtr){
        for(T* i = copyQueue.frontPtr; i &lt;= copyQueue.backPtr; i++){
            push(*i);
        }
    }
    else {
        for(T* i = copyQueue.frontPtr; i &lt;= (copyQueue.list + MAX_SIZE -1); i++){
            push(*i);

        }
        for(T* i = copyQueue.list; i &lt;= copyQueue.backPtr; i++) {
            push(*i);
        }
    }
}

template &lt;class T&gt;
bool Queue&lt;T&gt;::empty(void) const {
    return (sizeQ == 0);
}

template &lt;class T&gt;
std::size_t Queue&lt;T&gt;::size(void) const {
    return sizeQ;
}


template &lt;class T&gt;
void Queue&lt;T&gt;::clear(void) {
    frontPtr = nullptr;
    backPtr = nullptr;
    sizeQ = 0;
}

template &lt;class T&gt;
T Queue&lt;T&gt;::front(void) const {
    if(frontPtr == nullptr) {
        std::cerr &lt;&lt; "Queue is empty. No front value" &lt;&lt; '\n';
    }
    else {
        return *frontPtr;
    }
}

template &lt;class T&gt;
void Queue&lt;T&gt;::pop(void) {
    if(sizeQ == 0) {
        std::cerr &lt;&lt; "Queue is empty. Can't pop." &lt;&lt; '\n';
    }
    else{
        frontPtr = list + ((frontPtr - list + 1) % MAX_SIZE);
        sizeQ -= 1;
    }
}

template &lt;class T&gt;
void Queue&lt;T&gt;::push(T&amp; item) {
    if(sizeQ == MAX_SIZE) {
        std::cerr &lt;&lt; "Queue is full. Can't push" &lt;&lt; '\n';
    }
    else{
        if(sizeQ == 0) {
            frontPtr = backPtr = list;
        }
        else {
            backPtr = list + ((backPtr - list + 1) % MAX_SIZE);
        }
        *backPtr = item;
        sizeQ += 1;
    }
}

template &lt;class T&gt;
void Queue&lt;T&gt;::print(std::ostream&amp; os) {
    if(backPtr &gt;=frontPtr){
        for(T* i = frontPtr; i &lt;= backPtr; i++){
                os &lt;&lt; *i &lt;&lt; '\n';
        }
    }
    else {
        for(T* i = frontPtr; i &lt;= (list + MAX_SIZE -1); i++){
            os &lt;&lt; *i &lt;&lt; '\n';
        }
        for(T* i = list; i &lt;= backPtr; i++) {
            os &lt;&lt; *i &lt;&lt; '\n';
        }
    }
}



Edit: Not using googletest, but a simple main function to test the Queue.h can be found below:

#include "Queue.h"
int main() {
    Queue&lt;int&gt; newQueue;
    for(int i=1; i&lt;110; i = i+2)
        newQueue.push(i);
    newQueue.pop();
    newQueue.pop();
    newQueue.pop();
    newQueue.pop();
    int i = 999;
    newQueue.push(++i);
    newQueue.push(++i);
    newQueue.push(++i);
    newQueue.push(++i);
    newQueue.print(std::cout);
    Queue&lt;int&gt; copiedQueue(newQueue);
    std::cout &lt;&lt; copiedQueue.size() &lt;&lt; '\n';
    copiedQueue.print(std::cout);
    for(int i=1; i&lt;11; i = i+2)
        copiedQueue.pop();
    newQueue.print(std::cout);
    std::cout &lt;&lt; copiedQueue.empty();
    std::cout &lt;&lt; newQueue.empty();
    copiedQueue.print(std::cout);
    return 0;
}
Some general improvements:


Use &lt;cstdlib&gt;, not &lt;stdlib.h&gt;.  The latter is a deprecated header that is kept for C compatibility.  It should not be used in new C++ code. 
Do not use void in an empty parameter list.  It is counterintuitive and is not necessary in C++ at all.  It is only used in C prototypes.
The copy constructor should take by const reference because it does not modify the argument.  Same for push. 
You are using assignment in constructors when you ought to use member initializer clauses.  This is bad practice. 
front should return by const reference, not by value.  Returning by value makes an unnecessary copy. 
MAX_SIZE is not a macro and should not be in ALL_CAPS.  And it should be constexpr.  Or better, a template parameter. 
It is advised in C++ to use std::array instead of raw arrays. 


There are still many things to improve, but this should be enough to get you started.