title: std::find how does it work? operator==
body: <p>If I have a class</p>
  
  <pre><code>class Point
  {
  public:
    Point() {}
    Point(int _col, int _row) : row(_row), col(_col) {}
    int row, col;
  };
  </code></pre>
  
  <p>how can I use std::find() to check whether the point is already in vector? DO I have to overload operator== ?</p>
  
  <p>I am trying to do this</p>
  
  <pre><code>#include &lt;algorithm&gt;
  
  if(std::find(v.begin(), v.end(), x) != v.end()) {
      /* v contains x */
  } else {
      /* v does not contain x */
  }
  </code></pre>
  
  <p>Almost every answer I find on Stack Overflow suggest using find to check whether the object is in <code>std::vector</code> but none of them explains whether it compares the pointer of objects or the actual values of the object.</p>