title: Using vector std::find with a user-created object - third argument
body: <p>I am trying to make use of <code>std::find</code> to search a vector and return an iterator of the required object is found. The problem I am having is that I am not sure what to put as the third argument. Below is the relevant line of code as well as the definition of the object I am using.</p>
  
  <p><strong>Function:</strong></p>
  
  <pre><code>vector&lt;Vertex&gt;::const_iterator findV = find(testV.begin(), testV.end(), vtx); 
  //vtx is of type Vertex
  </code></pre>
  
  <p><strong>Class Definition:</strong></p>
  
  <pre><code>class Vertex
  {
      private:
          int currentIndex;
          double xPoint, yPoint, zPoint;
          vector&lt;double&gt; vertexAttributes;
  
      public:
          Vertex();
          ~Vertex();
  
          friend istream&amp; operator&gt;&gt;(istream&amp;, Vertex &amp;);
          friend ostream&amp; operator&lt;&lt;(ostream&amp;, const Vertex &amp;);
  
          double getIndex(){return currentIndex;}
          double get_xPoint(){return xPoint;}
          double get_yPoint(){return yPoint;}
          double get_zPoint(){return zPoint;}
  };
  </code></pre>
  
  <p>Logically I would assume that since I am searching for an object of type <code>Vertex</code>, the third argument should also be of this type, but this does not work.</p>
  
  <p>The error received is:</p>
  
  <pre><code>error: no match for 'operator==' (operand types are 'Vertex' and 'const Vertex')|
  </code></pre>
  
  <p>Please let me know if any further clarification is required.</p>
  
  <p>Thanks</p>