title: limit size of Queue<T> in C++
body: <p>I notice the thread of similar question: <a href="https://stackoverflow.com/questions/1292/limit-size-of-queuet-in-net">Limit size of Queue&lt;T&gt; in .NET?</a>
  That's exactly what I want to do, but I am not using .net but GNU C++. I have no reference to the base class in GNU C++, so java like <code>super.***()</code> or .net like <code>base.***()</code> will not work. I have been trying to inherit from queue class but it turns out in vain.</p>
  
  <p>What I want to do:
  specify the size of the queue, and automatically dequeue when the queue is full. To be specific: if the maximum size of my queue is 2, when I push the 3rd item, the 1st item will be automatically popped out before pushing the new item.</p>
  
  <p>How to implement such a queue?</p>
  
  <p>Thanks.</p>