/ StarOI /

记录详情

Compile Error

In file included from /usr/include/c++/6/queue:64:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:86,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_queue.h: In instantiation of 'class std::priority_queue<int, std::vector<int>, std::greater<int>()>':
/in/foo.cc:6:52:   required from here
/usr/include/c++/6/bits/stl_queue.h:424:18: error: field 'std::priority_queue<int, std::vector<int>, std::greater<int>()>::comp' invalidly declared function type
       _Compare   comp;
                  ^~~~
/usr/include/c++/6/bits/stl_queue.h: In constructor 'std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(const _Compare&, _Sequence&&) [with _Tp = int; _Sequence = std::vector<int>; _Compare = std::greater<int>()]':
/usr/include/c++/6/bits/stl_queue.h:444:44: error: value-initialization of function type 'std::greater<int>()'
       priority_queue(const _Compare& __x = _Compare(),
                                            ^~~~~~~~~~
/in/foo.cc:6:52: note:   when instantiating default argument for call to std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(const _Compare&, _Sequence&&) [with _Tp = int; _Sequence = std::vector<int>; _Compare = std::greater<int>()]
  priority_queue<int, vector<int>, greater<int>() > pq;
                                                    ^~
In file included from /usr/include/c++/6/bits/stl_algobase.h:71:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 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/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Value = int; _Compare = std::greater<int> (*)()]':
/usr/include/c++/6/bits/stl_heap.h:129:48:   required from 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Distance = long int; _Tp = int; _Compare = __gnu_cxx::__ops::_Iter_comp_val<std::greater<int> (*)()>]'
/usr/include/c++/6/bits/stl_heap.h:201:23:   required from 'void std::push_heap(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Compare = std::greater<int> (*)()]'
/usr/include/c++/6/bits/stl_queue.h:561:16:   required from 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = int; _Sequence = std::vector<int>; _Compare = std::greater<int>(); std::priority_queue<_Tp, _Sequence, _Compare>::value_type = int]'
/in/foo.cc:10:12:   required from here
/usr/include/c++/6/bits/predefined_ops.h:147:11: error: too many arguments to function
  { return bool(_M_comp(*__it, __val)); }
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/6/bits/predefined_ops.h:147:11: error: invalid cast from type 'std::greater<int>' to type 'bool'
/usr/include/c++/6/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Iterator2 = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Compare = std::greater<int> (*)()]':
/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<int*, std::vector<int> >; _Distance = long int; _Tp = int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<std::greater<int> (*)()>]'
/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<int*, std::vector<int> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<std::greater<int> (*)()>]'
/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<int*, std::vector<int> >; _Compare = std::greater<int> (*)()]'
/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 = int; _Sequence = std::vector<int>; _Compare = std::greater<int>()]'
/in/foo.cc:6:52:   required from here
/usr/include/c++/6/bits/predefined_ops.h:125:18: error: too many arguments to function
         { return bool(_M_comp(*__it1, *__it2)); }
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/6/bits/predefined_ops.h:125:18: error: invalid cast from type 'std::greater<int>' to type 'bool'

信息

递交者
类型
自测
题目
Bob and Chips
语言
C++
递交时间
2018-09-17 21:34:04
评测时间
2018-09-17 21:34:04
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes