Delayed Destruction of Queue Elements
This is probably by design, but unless I am misunderstanding the code, queue elements are not destructed when they are popped. Considering that they will eventually be destructed when the queue itself is destructed or the underlying array is resized, there is no memory leak in the strict sense of the word, but resources held by items stored in the queue can remain allocated potentially much longer than needed.
Consider the following use case: a hundred elements are added to the queue (for instance under heavy load in a task manager's queue), 95 of them are popped afterwards, and for the remainder of the application's lifetime, the queue size will not grow past 10. In this case, 90 resources will stay allocated for the entire duration of the application.
P.S. Thank you for sharing, both your code and thoughts (in your blog).