Implementation of a templatized queue backed by an array in C++