Compile Error

In file included from /usr/include/c++/6/string:48:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_function.h: In instantiation of 'bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = node]':
/usr/include/c++/6/bits/predefined_ops.h:125:18:   required from 'bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<node*, std::vector<node, std::allocator<node> > >; _Iterator2 = __gnu_cxx::__normal_iterator<node*, std::vector<node, std::allocator<node> > >; _Compare = std::less<node>]'
/usr/include/c++/6/bits/stl_heap.h:217:14:   required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<node*, std::vector<node, std::allocator<node> > >; _Distance = long int; _Tp = node; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<std::less<node> >]'
/usr/include/c++/6/bits/stl_heap.h:335:22:   required from 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<node*, std::vector<node, std::allocator<node> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<std::less<node> >]'
/usr/include/c++/6/bits/stl_heap.h:388:23:   required from 'void std::make_heap(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<node*, std::vector<node, std::allocator<node> > >; _Compare = std::less<node>]'
/usr/include/c++/6/bits/stl_queue.h:447:23:   required from 'std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(const _Compare&, _Sequence&&) [with _Tp = node; _Sequence = std::vector<node, std::allocator<node> >; _Compare = std::less<node>]'
/in/foo.cc:29:22:   required from here
/usr/include/c++/6/bits/stl_function.h:386:20: error: no match for 'operator<' (operand types are 'const node' and 'const node')
       { return __x < __y; }
                ~~~~^~~~~
In file included from /usr/include/c++/6/forward_list:38:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:104,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/forward_list.h:1376:5: note: candidate: template<class _Tp, class _Alloc> bool std::operator<(const std::forward_list<_Tp, _Alloc>&, const std::forward_list<_Tp, _Alloc>&)
     operator<(const forward_list<_Tp, _Alloc>& __lx,
     ^~~~~~~~
/usr/include/c++/6/bits/forward_list.h:1376:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/string:48:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_function.h:386:20: note:   'const node' is not derived from 'const std::forward_list<_Tp, _Alloc>'
       { return __x < __y; }
                ~~~~^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/valarray:1181:1: note: candidate: template<class _Tp> std::_Expr<std::_BinClos<std::__less, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__less, _Tp>::result_type> std::operator<(const _Tp&, const std::valarray<_Tp>&)
 _DEFINE_BINARY_OPERATOR(<, __less)
 ^
/usr/include/c++/6/valarray:1181:1: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/string:48:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_function.h:386:20: note:   'const node' is not derived from 'const std::valarray<_Tp>'
       { return __x < __y; }
                ~~~~^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/valarray:1181:1: note: candidate: template<class _Tp> std::_Expr<std::_BinClos<std::__less, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__less, _Tp>::result_type> std::operator<(const std::valarray<_Tp>&, const _Tp&)
 _DEFINE_BINARY_OPERATOR(<, __less)
 ^
/usr/include/c++/6/valarray:1181:1: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/string:48:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_function.h:386:20: note:   'const node' is not derived from 'const std::valarray<_Tp>'
       { return __x < __y; }
                ~~~~^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/valarray:1181:1: note: candidate: template<class _Tp> std::_Expr<std::_BinClos<std::__less, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__less, _Tp>::result_type> std::operator<(const std::valarray<_Tp>&, const std::valarray<_Tp>&)
 _DEFINE_BINARY_OPERATOR(<, __less)
 ^
/usr/include/c++/6/valarray:1181:1: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/string:48:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_function.h:386:20: note:   'const node' is not derived from 'const std::valarray<_Tp>'
       { return __x < __y; }
                ~~~~^~~~~
In file included from /usr/include/c++/6/valarray:587:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/valarray_after.h:416:5: note: candidate: template<class _Dom> std::_Expr<std::_BinClos<std::__less, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__less, typename _Dom1::value_type>::result_type> std::operator<(const std::valarray<typename _Dom::value_type>&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(<, __less)
     ^
/usr/include/c++/6/bits/valarray_after.h:416:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/string:48

信息

递交者
类型
递交
题目
「一本通 3.2 练习 7」道路和航线
语言
C++
递交时间
2020-10-17 21:49:01
评测时间
2020-10-17 21:49:01
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes