title: Pass std::max_element() or std::min_element() to function as argiment
body: <p>Is there any way to pass <code>std::max_element()</code> or <code>std::min_element()</code> to template class method? For example:</p>
  
  <pre><code>#include &lt;vector&gt;
  #include &lt;algorithms&gt;
  
  template &lt;typename T&gt;
  class A 
  {
  public: 
      int fooMax()
      {
          return foo(std::max_element());
      }
  
      int fooMin()
      {
          return foo(std::min_element());
      }
  
  private:
      std::vector&lt;T&gt; data_;
  
  private:
      int foo(??? func)
      {
          auto it = func(data_.begin(), data_.end());
  
          int i = do_something();
          return i;
      }
  };
  </code></pre>
  
  <p>I tried to use function pointers, but it did not compiled.</p>