title: error C2678 in using template
body: <p>I'm defining a priority queue and use it on a self-defined struct but I get this error and I don't know how to fix it.</p>
  
  <p>This is my error:   </p>
  
  <pre><code>error C2678: binary '&lt;' : no operator found which takes a left-hand operand 
  of type 'const Location' (or there is no acceptable conversion)
  </code></pre>
  
  <p>my struct Location</p>
  
  <pre><code>struct Location
  {
     int x, y, value;
     Location(int a, int b);
     bool operator == (const Location&amp; other);
     bool operator &lt; (const Location&amp; other);
  };
  
  Location:: Location(int a, int b) {
     x = a;
     y = b;
     value = 0;
  }
  
  bool Location:: operator == (const Location&amp; other) {
      return (x == other.x &amp;&amp; y == other.y);
  }
  
  bool Location:: operator &lt; (const Location&amp; other) {
      return value &gt; other.value;
  }
  </code></pre>
  
  <p>Here's my priority queue</p>
  
  <pre><code>template&lt;typename T&gt;
  struct my_priority_queue {
  
  priority_queue&lt;T, vector&lt;T&gt;, greater&lt;T&gt;&gt; elements;
  bool empty()
  {
      return elements.empty();
  }
  void push(T item)
  {
      elements.emplace(item);
  }
  T pop() 
  {
      T best = elements.top();
      elements.pop();
      return best;
  }
  };
  </code></pre>
  
  <p>The main function</p>
  
  <pre><code>int main() {
      Location a(0, 0);
      Location b(1, 2);
      Location c(3, 0);
      my_priority_queue&lt;Location&gt; my_pq;
      my_pq.push(a);
  }
  </code></pre>