title: c++ invalid operand to binary expression on xcode
body: <p>I'm still kind of new to C++ and I just can't figure out how to fix the error.  Error I'm getings is saying "Invalid operands to binary expression".  Does anyone have any idea on how to fix this?  Any help is appreciated!!  I'm using Xcode 4.5.2.  Thanks!</p>
  
  <p>[Edit] OK. I've updated the code below.  I'm still getting the same error at the same line (find())... but here are the changes...</p>
  
  <pre><code>Vertex myVertex = new Vertex(1); 
  </code></pre>
  
  <p>to</p>
  
  <pre><code>Vertex myVertex(1);
  </code></pre>
  
  <p>And added operator overload for &lt;</p>
  
  <pre><code>struct Vertex {
      int node;
      bool known;
      float distance;
      Vertex *path;
  
      Vertex(int n=0, bool known=false, duuble dist=INFINITY):
      node(n), known(known), distance(dist) {}
  };
  
  
  struct Edge {
      Vertex target;
      float weight;
      bool directed;
  
      Edge(Vertex v2, float w, bool dir):target(v2), weight(w), directed(dir) {}
  };
  
  class Graph {
  public:
      /*unrelated members are removed*/
  
      void findVertex() {
          Vertex myVertex(1);
          map&lt;Vertex, vector&lt;Edge&gt; &gt;::iterator itr;
          itr = edges.find(myVertex); // &lt;--- this is the line the error seems to related to
      }
  
      friend bool operator&lt; (const Vertex&amp; lhs, const Vertex&amp; rhs) {
          return lhs.node &lt; rhs.node;
      }
  
  
  
  private:
      /*unrelated members are removed*/
      vector&lt;Vertex&gt; vertices;
      map&lt;Vertex, vector&lt;Edge&gt; &gt; edges;
  };
  </code></pre>