记录详情

Compile Error

foo.cc: In constructor 'SeqList::SeqList(std::vector<int>)':
foo.cc:12:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |         for (int i = 0; i < seq.size(); ++i) {
      |                         ~~^~~~~~~~~~~~
foo.cc:15:25: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   15 |                 if (find(seq.begin(), seq.end(), neg) != seq.end()) {
      |                     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /nix/gcc-13.2.0/include/c++/13.2.0/bits/locale_facets.h:48,
                 from /nix/gcc-13.2.0/include/c++/13.2.0/bits/basic_ios.h:37,
                 from /nix/gcc-13.2.0/include/c++/13.2.0/ios:46,
                 from /nix/gcc-13.2.0/include/c++/13.2.0/ostream:40,
                 from iostream:41:
/nix/gcc-13.2.0/include/c++/13.2.0/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/nix/gcc-13.2.0/include/c++/13.2.0/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
foo.cc:15:25: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   15 |                 if (find(seq.begin(), seq.end(), neg) != seq.end()) {
      |                     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc: In member function 'std::vector<int> SeqList::Union(SeqList&)':
foo.cc:35:38: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   35 |                 if (pos != -1 && find(ansseq.begin(), ansseq.end(), pos) == ansseq.end()) {
      |                                  ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-13.2.0/include/c++/13.2.0/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/nix/gcc-13.2.0/include/c++/13.2.0/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
foo.cc:35:38: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   35 |                 if (pos != -1 && find(ansseq.begin(), ansseq.end(), pos) == ansseq.end()) {
      |                                  ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:42:30: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   42 |             if (x > 0 && find(ansseq.begin(), ansseq.end(), x) == ansseq.end()) {
      |                          ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/gcc-13.2.0/include/c++/13.2.0/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/nix/gcc-13.2.0/include/c++/13.2.0/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
foo.cc:42:30: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   42 |             if (x > 0 && find(ansseq.begin(), ansseq.end(), x) == ansseq.end()) {
      |                          ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

信息

递交者
类型
自测
题目
P1014 OO3-1 无序顺序表类的基本运算
语言
C++
递交时间
2024-03-18 22:31:23
评测时间
2024-03-18 22:31:23
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes