title: Why lambda function doesn't work with std::min_element?
body: <p>I wrote a program to find the lexicographically minimum string in a vector of strings using <code>std::min_element</code>, but I want to get the minimum string that its length is greater than 1. I tried to do <code>std::min_element</code> with lambda expressions, but I got a compilation error.</p>
  
  <p>I've tried to search for that, but couldn't get anything that solves the problem. </p>
  
  <pre><code>vector&lt;string&gt; names{"Jason", "Peter", "A", "Ac", "O"};
  cout &lt;&lt; *min_element(names.begin(), names.end(), [](string s) {return s.length() &gt; 1;}) &lt;&lt; '\n';
  </code></pre>
  
  <p>PS: I'm expecting this to print "Ac".</p>