title: STL Priority Queue on custom class
body: <p>I'm having a lot of trouble getting my priority queue to recognize which parameter it should sort by. I've overloaded the less than operator in my custom class but it doesn't seem to use it. Here's the relevant code:</p>
  
  <p>Node.h</p>
  
  <pre><code>class Node
  {   
  public:
      Node(...);
      ~Node();
      bool operator&lt;(Node &amp;aNode);
  ...
  }
  </code></pre>
  
  <p>Node.cpp</p>
  
  <pre><code>#include "Node.h"
  bool Node::operator&lt;(Node &amp;aNode)
  {
      return (this-&gt;getTotalCost() &lt; aNode.getTotalCost());
  }
  </code></pre>
  
  <p>getTotalCost() returns an int</p>
  
  <p>main.cpp</p>
  
  <pre><code>priority_queue&lt;Node*, vector&lt;Node*&gt;,less&lt;vector&lt;Node*&gt;::value_type&gt; &gt; nodesToCheck;
  </code></pre>
  
  <p>What am I missing and/or doing wrong?</p>