title: How to declare priority queue in function parameter in c++
body: <p>I have declare a priority queue for with minimum element at the top as follows</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>priority_queue&lt;int, vector&lt;int&gt; , greater&lt;vector&lt;int&gt;&gt; &gt; low;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Now I want to pass this object to some function, for this i need to declare in function header, I tried declaring following ways</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>int fun1(priority_queue&lt;int, vector&lt;int&gt; , greater&lt;vector&lt;int&gt;&gt; &gt; min_heap){
  return 0;
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>int fun2(priority_queue&lt;int&gt; min_heap){
  return 0;
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>in both approach i am getting compilation error;
  second approach is obvious to give error because of type mismatch but compiler does not allow to do first approach.
  Please help me.</p>