C++ 无法推送列表上的\u堆<;int>;,关于向量的工作

C++ 无法推送列表上的\u堆<;int>;,关于向量的工作,c++,C++,我试图在列表上推\u heap,但编译失败,抱怨列表迭代器。如果我将列表更改为向量,它可以正常工作 查看cpp引用,我无法理解为什么列表迭代器的行为会有所不同。也许有人能给我们点启示 #包括 #包括 #包括 使用名称空间std; int main(){ 清单l; l、 推回(0); push_heap(l.begin()、l.end()、greater()); 返回0; } 错误: In file included from /usr/include/c++/6/bits/stl_pair.

我试图在
列表
上推\u heap,但编译失败,抱怨列表迭代器。如果我将列表更改为向量,它可以正常工作

查看cpp引用,我无法理解为什么列表迭代器的行为会有所不同。也许有人能给我们点启示

#包括
#包括
#包括
使用名称空间std;
int main(){
清单l;
l、 推回(0);
push_heap(l.begin()、l.end()、greater());
返回0;
}
错误:

In file included from /usr/include/c++/6/bits/stl_pair.h:59:0,
                 from /usr/include/c++/6/utility:70,
                 from /usr/include/c++/6/algorithm:60,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h: In instantiation of ‘void std::push_heap(_RAIter, _RAIter, _Compare) [with _RAIter = std::_List_iterator<int>; _Compare = std::greater<int>]’:
prog.cpp:13:48:   required from here
/usr/include/c++/6/bits/stl_heap.h:200:28: error: no match for ‘operator-’ (operand types are ‘std::_List_iterator<int>’ and ‘int’)
       _ValueType __value = _GLIBCXX_MOVE(*(__last - 1));
                            ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:333:5: note: candidate: template<class _Iterator> decltype ((__x.base() - __y.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
     operator-(const reverse_iterator<_Iterator>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:333:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/bits/stl_pair.h:59:0,
                 from /usr/include/c++/6/utility:70,
                 from /usr/include/c++/6/algorithm:60,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:200:28: note:   ‘std::_List_iterator<int>’ is not derived from ‘const std::reverse_iterator<_Iterator>’
       _ValueType __value = _GLIBCXX_MOVE(*(__last - 1));
                            ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:387:5: note: candidate: template<class _IteratorL, class _IteratorR> decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator-(const reverse_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:387:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/bits/stl_pair.h:59:0,
                 from /usr/include/c++/6/utility:70,
                 from /usr/include/c++/6/algorithm:60,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:200:28: note:   ‘std::_List_iterator<int>’ is not derived from ‘const std::reverse_iterator<_Iterator>’
       _ValueType __value = _GLIBCXX_MOVE(*(__last - 1));
                            ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1186:5: note: candidate: template<class _IteratorL, class _IteratorR> decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
     operator-(const move_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1186:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/bits/stl_pair.h:59:0,
                 from /usr/include/c++/6/utility:70,
                 from /usr/include/c++/6/algorithm:60,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:200:28: note:   ‘std::_List_iterator<int>’ is not derived from ‘const std::move_iterator<_IteratorL>’
       _ValueType __value = _GLIBCXX_MOVE(*(__last - 1));
                            ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1193:5: note: candidate: template<class _Iterator> decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)
     operator-(const move_iterator<_Iterator>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1193:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/bits/stl_pair.h:59:0,
                 from /usr/include/c++/6/utility:70,
                 from /usr/include/c++/6/algorithm:60,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:200:28: note:   ‘std::_List_iterator<int>’ is not derived from ‘const std::move_iterator<_IteratorL>’
       _ValueType __value = _GLIBCXX_MOVE(*(__last - 1));
                            ^
In file included from /usr/include/c++/6/bits/stl_algo.h:61:0,
                 from /usr/include/c++/6/algorithm:62,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:201:55: error: no match for ‘operator-’ (operand types are ‘std::_List_iterator<int>’ and ‘std::_List_iterator<int>’)
       std::__push_heap(__first, _DistanceType((__last - __first) - 1),
                                               ~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:333:5: note: candidate: template<class _Iterator> decltype ((__x.base() - __y.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
     operator-(const reverse_iterator<_Iterator>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:333:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/bits/stl_algo.h:61:0,
                 from /usr/include/c++/6/algorithm:62,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:201:55: note:   ‘std::_List_iterator<int>’ is not derived from ‘const std::reverse_iterator<_Iterator>’
       std::__push_heap(__first, _DistanceType((__last - __first) - 1),
                                               ~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:387:5: note: candidate: template<class _IteratorL, class _IteratorR> decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator-(const reverse_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:387:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/bits/stl_algo.h:61:0,
                 from /usr/include/c++/6/algorithm:62,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:201:55: note:   ‘std::_List_iterator<int>’ is not derived from ‘const std::reverse_iterator<_Iterator>’
       std::__push_heap(__first, _DistanceType((__last - __first) - 1),
                                               ~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1186:5: note: candidate: template<class _IteratorL, class _IteratorR> decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
     operator-(const move_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1186:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/bits/stl_algo.h:61:0,
                 from /usr/include/c++/6/algorithm:62,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:201:55: note:   ‘std::_List_iterator<int>’ is not derived from ‘const std::move_iterator<_IteratorL>’
       std::__push_heap(__first, _DistanceType((__last - __first) - 1),
                                               ~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1193:5: note: candidate: template<class _Iterator> decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)
     operator-(const move_iterator<_Iterator>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1193:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/bits/stl_algo.h:61:0,
                 from /usr/include/c++/6/algorithm:62,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:201:55: note:   ‘std::_List_iterator<int>’ is not derived from ‘const std::move_iterator<_IteratorL>’
       std::__push_heap(__first, _DistanceType((__last - __first) - 1),
                                               ~~~~~~~~^~~~~~~~~~
在/usr/include/c++/6/bits/stl_pair.h:59:0中包含的文件中,
从/usr/include/c++/6/utility:70,
从/usr/include/c++/6/算法:60,
来自项目cpp:1:
/usr/include/c++/6/bits/stl_heap.h:在“void std::push_heap(_RAIter,_RAIter,_Compare)[with _RAIter=std::_List_iterator;_Compare=std::morer]的实例化中:
进度cpp:13:48:从这里开始需要
/usr/include/c++/6/bits/stl_heap.h:200:28:错误:与“operator-”不匹配(操作数类型为“std::_List_iterator”和“int”)
_ValueType uuu value=_GLIBCXX_MOVE(*(uuuu last-1));
^
在/usr/include/c++/6/bits/stl_algobase.h:67:0中包含的文件中,
来自/usr/include/c++/6/算法:61,
来自项目cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:333:5:注:候选:模板decltype((uuu x.base()-u y.base())std::operator-(const std::reverse_iterator&,const std::reverse_iterator&)
运算符-(常量反向迭代器和,
^~~~~~~~
/usr/include/c++/6/bits/stl_迭代器。h:333:5:注意:模板参数推导/替换失败:
在/usr/include/c++/6/bits/stl_pair.h:59:0中包含的文件中,
从/usr/include/c++/6/utility:70,
从/usr/include/c++/6/算法:60,
来自项目cpp:1:
/usr/include/c++/6/bits/stl_heap.h:200:28:注意:“std::_List_iterator”不是从“const std::reverse_iterator”派生的
_ValueType uuu value=_GLIBCXX_MOVE(*(uuuu last-1));
^
在/usr/include/c++/6/bits/stl_algobase.h:67:0中包含的文件中,
来自/usr/include/c++/6/算法:61,
来自项目cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:387:5:注:候选:模板decltype((uu y.base()-u x.base())std::operator-(const std::reverse_iterator&,const std::reverse_iterator&)
运算符-(常量反向迭代器和,
^~~~~~~~
/usr/include/c++/6/bits/stl_迭代器。h:387:5:注意:模板参数推导/替换失败:
在/usr/include/c++/6/bits/stl_pair.h:59:0中包含的文件中,
从/usr/include/c++/6/utility:70,
从/usr/include/c++/6/算法:60,
来自项目cpp:1:
/usr/include/c++/6/bits/stl_heap.h:200:28:注意:“std::_List_iterator”不是从“const std::reverse_iterator”派生的
_ValueType uuu value=_GLIBCXX_MOVE(*(uuuu last-1));
^
在/usr/include/c++/6/bits/stl_algobase.h:67:0中包含的文件中,
来自/usr/include/c++/6/算法:61,
来自项目cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1186:5:注:候选:模板decltype((uu x.base()-u y.base())std::operator-(const std::move_iterator&,const std::move_iterator&)
运算符-(常量移动\u迭代器&\u x,
^~~~~~~~
/usr/include/c++/6/bits/stl_迭代器。h:1186:5:注意:模板参数推导/替换失败:
在/usr/include/c++/6/bits/stl_pair.h:59:0中包含的文件中,
从/usr/include/c++/6/utility:70,
从/usr/include/c++/6/算法:60,
来自项目cpp:1:
/usr/include/c++/6/bits/stl_heap.h:200:28:注意:“std::_List_iterator”不是从“const std::move_iterator”派生的
_ValueType uuu value=_GLIBCXX_MOVE(*(uuuu last-1));
^
在/usr/include/c++/6/bits/stl_algobase.h:67:0中包含的文件中,
来自/usr/include/c++/6/算法:61,
来自项目cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1193:5:注:候选:模板decltype((uu x.base()-u y.base())std::operator-(const std::move_iterator&,const std::move_iterator&)
运算符-(常量移动\u迭代器&\u x,
^~~~~~~~
/usr/include/c++/6/bits/stl_迭代器。h:1193:5:注意:模板参数推导/替换失败:
在/usr/include/c++/6/bits/stl_pair.h:59:0中包含的文件中,
从/usr/include/c++/6/utility:70,
从/usr/include/c++/6/算法:60,
来自项目cpp:1:
/usr/include/c++/6/bits/stl_heap.h:200:28:注意:“std::_List_iterator”不是从“const std::move_iterator”派生的
_ValueType uuu value=_GLIBCXX_MOVE(*(uuuu last-1));
^
在/usr/include/c++/6/bits/stl_algo.h:61:0中包含的文件中,
来自/usr/include/c++/6/算法:62,
来自项目cpp:1:
/usr/include/c++/6/bits/stl_heap.h:201:55:错误:与“运算符-”不匹配(操作数类型为“std::_List_iterator”和“std:_List_iterator”)
std::uuu推送_u堆(uuu第一,u距离类型((uuu最后-uu第一)-1),
~~~~~~~~^~~~~~~~~~
在/usr/include/c++/6/bits/stl_algobase.h:67:0中包含的文件中,
来自/usr/include/c++/6/算法:61,
来自项目cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:333:5:注:候选:模板decltype((uuu x.base()-u y.base())std::operator-(const std::reverse_iterator&,const std::reverse_iterator&)
运算符-(常量反向迭代器和,
^~~~~~~~
/usr/include/c++/6/bits/stl_迭代器。h:333:5:注意:模板参数推导/替换失败:
在/usr/include/c++/6/bits/stl_algo.h:61:0中包含的文件中,
来自/usr/include/c++/6/算法:62,
来自项目cpp:1:
/usr/include/c++/6/
In file included from /usr/include/c++/6/bits/stl_pair.h:59:0,
                 from /usr/include/c++/6/utility:70,
                 from /usr/include/c++/6/algorithm:60,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h: In instantiation of ‘void std::push_heap(_RAIter, _RAIter, _Compare) [with _RAIter = std::_List_iterator<int>; _Compare = std::greater<int>]’:
prog.cpp:13:48:   required from here
/usr/include/c++/6/bits/stl_heap.h:200:28: error: no match for ‘operator-’ (operand types are ‘std::_List_iterator<int>’ and ‘int’)
       _ValueType __value = _GLIBCXX_MOVE(*(__last - 1));
                            ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:333:5: note: candidate: template<class _Iterator> decltype ((__x.base() - __y.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
     operator-(const reverse_iterator<_Iterator>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:333:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/bits/stl_pair.h:59:0,
                 from /usr/include/c++/6/utility:70,
                 from /usr/include/c++/6/algorithm:60,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:200:28: note:   ‘std::_List_iterator<int>’ is not derived from ‘const std::reverse_iterator<_Iterator>’
       _ValueType __value = _GLIBCXX_MOVE(*(__last - 1));
                            ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:387:5: note: candidate: template<class _IteratorL, class _IteratorR> decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator-(const reverse_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:387:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/bits/stl_pair.h:59:0,
                 from /usr/include/c++/6/utility:70,
                 from /usr/include/c++/6/algorithm:60,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:200:28: note:   ‘std::_List_iterator<int>’ is not derived from ‘const std::reverse_iterator<_Iterator>’
       _ValueType __value = _GLIBCXX_MOVE(*(__last - 1));
                            ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1186:5: note: candidate: template<class _IteratorL, class _IteratorR> decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
     operator-(const move_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1186:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/bits/stl_pair.h:59:0,
                 from /usr/include/c++/6/utility:70,
                 from /usr/include/c++/6/algorithm:60,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:200:28: note:   ‘std::_List_iterator<int>’ is not derived from ‘const std::move_iterator<_IteratorL>’
       _ValueType __value = _GLIBCXX_MOVE(*(__last - 1));
                            ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1193:5: note: candidate: template<class _Iterator> decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)
     operator-(const move_iterator<_Iterator>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1193:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/bits/stl_pair.h:59:0,
                 from /usr/include/c++/6/utility:70,
                 from /usr/include/c++/6/algorithm:60,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:200:28: note:   ‘std::_List_iterator<int>’ is not derived from ‘const std::move_iterator<_IteratorL>’
       _ValueType __value = _GLIBCXX_MOVE(*(__last - 1));
                            ^
In file included from /usr/include/c++/6/bits/stl_algo.h:61:0,
                 from /usr/include/c++/6/algorithm:62,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:201:55: error: no match for ‘operator-’ (operand types are ‘std::_List_iterator<int>’ and ‘std::_List_iterator<int>’)
       std::__push_heap(__first, _DistanceType((__last - __first) - 1),
                                               ~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:333:5: note: candidate: template<class _Iterator> decltype ((__x.base() - __y.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
     operator-(const reverse_iterator<_Iterator>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:333:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/bits/stl_algo.h:61:0,
                 from /usr/include/c++/6/algorithm:62,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:201:55: note:   ‘std::_List_iterator<int>’ is not derived from ‘const std::reverse_iterator<_Iterator>’
       std::__push_heap(__first, _DistanceType((__last - __first) - 1),
                                               ~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:387:5: note: candidate: template<class _IteratorL, class _IteratorR> decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator-(const reverse_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:387:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/bits/stl_algo.h:61:0,
                 from /usr/include/c++/6/algorithm:62,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:201:55: note:   ‘std::_List_iterator<int>’ is not derived from ‘const std::reverse_iterator<_Iterator>’
       std::__push_heap(__first, _DistanceType((__last - __first) - 1),
                                               ~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1186:5: note: candidate: template<class _IteratorL, class _IteratorR> decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
     operator-(const move_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1186:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/bits/stl_algo.h:61:0,
                 from /usr/include/c++/6/algorithm:62,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:201:55: note:   ‘std::_List_iterator<int>’ is not derived from ‘const std::move_iterator<_IteratorL>’
       std::__push_heap(__first, _DistanceType((__last - __first) - 1),
                                               ~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/algorithm:61,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_iterator.h:1193:5: note: candidate: template<class _Iterator> decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)
     operator-(const move_iterator<_Iterator>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1193:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/bits/stl_algo.h:61:0,
                 from /usr/include/c++/6/algorithm:62,
                 from prog.cpp:1:
/usr/include/c++/6/bits/stl_heap.h:201:55: note:   ‘std::_List_iterator<int>’ is not derived from ‘const std::move_iterator<_IteratorL>’
       std::__push_heap(__first, _DistanceType((__last - __first) - 1),
                                               ~~~~~~~~^~~~~~~~~~