Im trying to write my own code for a queue and will be using the new and delete commands but i want to be sure this code wont have memory leaks or other problems.

Its a simple class for queues and the size of the queue is known at compile time, so this shouldnt be a problem.

Its my first time using new, delete and templates, so suggestions would be greatly helpful.

```
template <typename T>
class Queue {
public:
Queue(uint16_t size);
~Queue();
T deQueue();
bool enQueue(T in);
bool isEmpty() { return numElements == 0 ? true : false; };
bool isFull() { return numElements == size ? true : false; };
T rear() { return queue[head == 0 ? (size - 1) : (head - 1)]; };
T front() { return queue[tail]; };
private:
T *queue;
uint16_t head = 0;
uint16_t tail = 0;
uint16_t size;
uint16_t numElements = 0;
};
template <typename T>
Queue<T>::Queue(uint16_t _size) {
size = _size;
queue = new T[size];
}
template <typename T>
Queue<T>::~Queue() {
delete [] queue;
}
template <typename T>
T Queue<T>::deQueue() {
T obj = NULL;
if (numElements == 0) return obj;
obj = queue[tail];
tail++;
numElements--;
if (tail >= size) tail = 0;
return obj;
}
template <typename T>
bool Queue<T>::enQueue(T in) {
if (numElements == size) return false;
queue[head] = in;
head++;
numElements++;
if (head == size) head = 0;
return true;
}
```