title: Find if an object attribute is in the Vector of objects C++
body: <p>I am trying to find if an object's attribute is in the vector.
  For example, if I have a vector of Car objects and the Car object have attributes of license, direction, and time. And I want to find if direction 'N' is in the vector of Car object. And return true or false if the attribute is in the vector of Cars.</p>
  
  <p>This is the function I have so far, but I want to use the stl find() method to search for the attribute:</p>
  
  <pre><code>bool isIn(std::vector&lt;Car *&gt; c, std::string check){
  for (auto i = 0; i &lt; c.size(); i++)
  {
      if (c[i]-&gt;dir == check)
      {
          return true;
      }
  }
  return false;
  </code></pre>
  
  <p>}</p>
  
  <p>The arguments that are passed in are the vector of Cars and the direction.</p>