I need to iterate over
By default, if no container class is specified for a particular queue class, the standard container class template deque is used.
If you need to iterate over a
queue then you need something more than a queue. The point of the standard container adapters is to provide a minimal interface. If you need to do iteration as well, why not just use a deque (or list) instead?