Does anyone know why std::queue, std::stack, and std::priority_queue don\'t provide a clear() member function? I have to fake one like this:
st
Deque has clear(). See, e.g., http://www.cplusplus.com/reference/stl/deque/clear.html.
However, queue does not. But why would you choose queue over deque, anyway?
The only reason to use the container adaptor queue instead of the container deque is to make it clear that you are performing only queue operations, and no other operations.
(http://www.sgi.com/tech/stl/queue.html)
So I guess clear() is not a queue operation, then.