title: Overloading operator< for priority queue
body: <p>I am trying to make a priority queue of a class I made like this - </p>
  
  <pre><code>std::priority_queue&lt;Position&gt; nodes;
  </code></pre>
  
  <p>I overloaded the &lt; operator in Position like this - </p>
  
  <pre><code>bool Position::operator&lt;(Position&amp; right) {
      return (fvalue &lt; right.getFValue());
  }
  </code></pre>
  
  <p>However, whenever I try to compile I get this error message saying the &lt; operator is not overloaded - </p>
  
  <pre><code>error: no match for ‘operator&lt;’ in ‘__x &lt; __y’
  position.h:30: note: candidates are: bool Position::operator&lt;(Position&amp;)
  </code></pre>
  
  <p>What am I missing here? Any help is appreciated.</p>