title: In c++11, how can I call std::max on a vector?
body: <p>I have a <code>vector&lt;data&gt;</code> (where <code>data</code> is my own pet type) and I want to find its maximum value.</p>
  
  <p>The standard <code>std::max</code> function in C++11 appears to work on a collection of objects, but it wants an initializer list as its first argument, not a collection like <code>vector</code> :</p>
  
  <pre><code>vector&lt;data&gt; vd;
  std::max(vd); // Compilation error
  std::max({vd[0], vd[1], vd[2]}); // Works, but not ok since I don't vd.size() at compile time
  </code></pre>
  
  <p>How can I solve this ?</p>