1. template <class RandomAccessIterator> 
  2. void sort_heap(RandomAccessIterator first, RandomAccessIterator last) { 
  3.     while(last - first > 1) 
  4.         pop_heap(first, last--); 

注:pop_heap源码请见http://zxn990.blog.51cto.com/4253193/1165524