title: Check if point is inside vector
body: <p>I want to check if a given point with <code>x</code> and <code>y</code>value is inside a vector of points:</p>
  
  <pre><code>bool inside_vector(int x, int y, vector&lt;Point2i&gt;&amp; points)
  {
    for(vector&lt;Point2i&gt;::const_iterator it = points.begin();
      it != points.end();
      ++it)
    {
      if(it-&gt;x == y &amp;&amp; it-&gt;y == y)
      {
        return true;
      }
    }
    return false;
  }
  </code></pre>
  
  <p>Are there other approaches without the <code>for</code> loop?</p>