title: How to get max_element from vector<std::string>
body: <p>Using the code from  <a href="http://www.cplusplus.com/reference/algorithm/max_element/" rel="nofollow">cplusplus.com</a>, I am trying to find the max int value in an <code>vector&lt;std::string&gt;</code>.
  the vector is in std::string format and there is no choice here. </p>
  
  <pre><code>bool myfn(int i, int j)
  {
      return i &lt; j;
  }
  
  vector&lt;std::string&gt; dat;
  dat.push_back(2.1);
  dat.push_back(5.3);
  
  for (int l = 0; l &lt; dat.size(); ++l)
  {
      std::cout &lt;&lt; *std::max_element(dat.begin(), dat.end(), myfn) &lt;&lt; '\n';
  }
  </code></pre>
  
  <p>expected output:</p>
  
  <pre><code>3
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>.cpp:76:93: error: no matching function for call to 'max_element(std::vector&lt;std::basic_string&lt;char&gt; &gt;&amp;, std::vector&lt;std::basic_string&lt;char&gt; &gt;::size_type, bool (&amp;)(int, int))'
  </code></pre>
  
  <p>How do you find the max value in a <code>vector&lt;std::string&gt;</code>?</p>