#ifndef QUEUE_STATIC #define QUEUE_STATIC #include #define QUEUE_SIZE 1024 template class Queue { T vals[QUEUE_SIZE]; unsigned frontInd; unsigned backInd; public: void push(const T& v); void pop(); T& front(); }; template void Queue::push(const T& v) { vals[backInd++ % QUEUE_SIZE] = v; if (backInd == frontInd) throw std::logic_error("Queue overfill!"); } template void Queue::pop() { frontInd++; } template T& Queue::front() { return vals[frontInd]; } #endif