A queue can expose its operations through operators too. The interesting pair is the decrements: postfix and prefix drop from OPPOSITE ends here, so one cannot be implemented through the other. And x + q with the int on the left is a free function again.
Implement Queue: q + x enqueues at the back, x + q pushes to the front, q-- drops the BACK element, --q drops the FRONT one. front()/size() expose state for the checks.
operator--(int) is the postfix form — the dummy int only selects the overload.
std::deque underneath gives both pop_front and pop_back for free.
Hit Submit (or ⌘/Ctrl + ↵) — test results will show up here.