title: Why does a priority queue require front(), pop_back() from the underlying container instead of back(), pop_back()?
body: <p>From <em>C++ Primer</em> and also <a href="https://en.cppreference.com/w/cpp/container/priority_queue" rel="nofollow noreferrer">https://en.cppreference.com/w/cpp/container/priority_queue</a>, I know: </p>
  
  <blockquote>
    <p>A priority_queue requires random access
    in addition to the front, push_back, and pop_back operations;</p>
  </blockquote>
  
  <p>I also read this <a href="https://www.fluentcpp.com/2018/03/20/heaps-and-priority-queues-in-c-part-3-queues-and-priority-queues/" rel="nofollow noreferrer">blog post</a> from Google and know:</p>
  
  <blockquote>
    <ul>
    <li>push: add a new element to the queue,</li>
    <li>pop: remove the largest element of the queue,</li>
    <li>top: access the largest element of the queue.</li>
    </ul>
  </blockquote>
  
  <p><code>push</code> should be implemented by <code>push_back</code>, no problem.
  And <code>pop</code> and <code>top</code> seem to operate on the same element. One is to access it, the other removes it. So I think these two operations should be implemented by <code>pop_front()</code> and <code>front()</code> or <code>pop_back()</code> and <code>back()</code>.</p>
  
  <p>So I am confused, why are the requirements <code>front()</code> and <code>pop_back()</code>?</p>
  
  <p>Let's for example assume the underlying container is a <code>vector</code> and with some int elements let's say <code>1,2,3,4,5,6</code>. How does the adaptor interface "<code>pop()</code>, <code>top()</code>" work with the underlying "<code>front()</code>, <code>pop_back()</code>"?</p>