title: The working of constructor of priority queue
body: <p>Can anyone please elaborate how the objects are compared before insertion in the priority queue for following code. Also what is significance of p(comp) in the constructor of priority queue..
  code--</p>
  
  <pre><code>#include&lt;bits/stdc++.h&gt;
  using namespace std;
  
  struct trainer
  {  int a, int b;  }
  
  bool comp(trainer x,trainer y)
  {  return x.a&gt;y.a;  }
  
  int main(void)
  {
    priority_queue&lt;trainer, vector&lt;trainer&gt;, function&lt;bool(trainer,trainer)&gt; &gt; p(comp);
    trainer x1,x2,x3;
    x1.a=2;x1.b=3;
    x2.a=9;x2.b=1;
    x3.a=21;x3.b=22;
    p.push(x2);p.push(x1);p.push(x3);
  }
  </code></pre>