title: std::priority_queue: Custom ordering without defining comparator class
body: <p>I want to have a priority queue with custom ordering, but lazy as I am, I don't want to define a comparator class implementing operator().</p>
  
  <p>I really would like something like this to compile:</p>
  
  <pre><code>std::priority_queue&lt;int, std::vector&lt;int&gt;, 
      boost::bind(some_function, _1, _2, obj1, obj2)&gt; queue;
  </code></pre>
  
  <p>where some_function is a bool returning function taking four arguments, the first and second being ints of the queue, and the two last ones some objects needed for calculating the ordering (const references).</p>
  
  <blockquote>
    <p>(error: ‘boost::bind’ cannot appear in a constant-expression)</p>
  </blockquote>
  
  <p>But this doesn't compile. Even a more simple</p>
  
  <pre><code>std::priority_queue&lt;int, std::vector&lt;int&gt;, &amp;compare&gt; queue;
  </code></pre>
  
  <p>won't compile, with compare being a binary function returning bool.</p>
  
  <blockquote>
    <p>(error: type/value mismatch at argument 3 in template parameter list for ‘template class std::priority_queue’; expected a type, got ‘compare’)</p>
  </blockquote>
  
  <p>Any suggestions?</p>