title: Priority queue in reverse order
body: <p><a href="http://www.cplusplus.com/reference/queue/priority_queue/priority_queue/" rel="noreferrer">This site</a> suggests that if I want to reverse-order my priority queues, the following code is what I should use:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;queue&gt;
  using namespace std;
  
  class mycomparison{
      bool reverse;
    public:
      mycomparison(const bool &amp;revparam=false) {reverse=revparam;}
      bool operator() (const int &amp;lhs, const int &amp;rhs) const {
        if (reverse) return (lhs&gt;rhs);
        else         return (lhs&lt;rhs);
      }
  };
  
  int main (){
    int myints[]= {10,60,50,20};
  
    priority_queue&lt;int, vector&lt;int&gt;, mycomparison(true)&gt; first;
  
    return 0;
  }
  </code></pre>
  
  <p>This bothers me:</p>
  
  <ul>
  <li>I have to specify the storage class in my constructor.</li>
  <li>I have created a class whose <em>only</em> purpose is to be passed to the priority queue.</li>
  </ul>
  
  <p>Is there a more elegant or less verbose way of reverse-sorting a priority queue?</p>