title: min_element() within template class
body: <p>I'm trying to build a home-made min-heap with template class so I can work on Dijkstra or Prim. However the find_min() function does not work with std::min_element(). Any clue will be greatly appreciated. Thanks!</p>
  
  <p>the error message from VC2010express, in short, says </p>
  
  <blockquote>
    <p>error C2780: '_FwdIt std::min_element(_FwdIt,_FwdIt)' : expects 2 arguments - 3 provided</p>
  </blockquote>
  
  <p>and the code below:</p>
  
  <pre><code>#ifndef MIN_HEAP_H
  #define MIN_HEAP_H//use (unsorted) vector and min() algorithm
  #include &lt;vector&gt;
  #include &lt;algorithm&gt;
  #include &lt;functional&gt;
  template &lt;typename T&gt;
  class MinHeap{
      std::vector&lt;T&gt; c;//container
      typedef typename std::vector&lt;T&gt;::iterator iterator;
      bool compare_node(const T&amp; lhs,const T&amp; rhs) const {return lhs&lt;rhs;}//define compare function for nodes
  public:
      MinHeap():c(){}//default constructor
  
      inline void insert(T node){c.push_back(node);}
  
      iterator find_min(){
          iterator min_node=std::min_element(c.begin(),c.end(),compare_node);//doesn't build
          return min_node;
      }
  //  deleteMin();
  //  deleteNode(node);
  //  decreaseKey(node);
  };
  #endif
  </code></pre>