title: Finding if a vector of pair<string,string> contains pairs that match on the first string
body: <p>Right, I know the title is pretty convoluted, so I'll try to explain my situation:</p>
  
  <p>I have a vector of pairs of strings, <code>std::vector&lt; std::pair&lt;std::string, std::string&gt; &gt;</code> which contains pairs of <strong>names</strong> and <strong>surnames</strong>.</p>
  
  <p>Is there a go-to simple way of using <code>find</code> or <code>find_if</code> to get all pairs in my <code>vector</code> that match only on the first part of the pairs?</p>
  
  <p><strong>For example,</strong> if my vector contains the pairs:</p>
  
  <pre><code>John Doe
  Ivan Ivanovitch
  Richard Stallman
  </code></pre>
  
  <p>is there a way to use <code>find</code> or <code>find_if</code> to check if my vector contains any <code>pair</code>s that match with the first name <code>John</code>, disregarding the last name (which I will use later on)?</p>
  
  <p>Suppose that my vector only contains distinctly different names and surnames and there's never pairs that have the same <code>first</code>, meaning no two <code>John</code>s or <code>Richard</code>s.</p>