Borderou de evaluare (job #2890479)
Utilizator | Data | 15 aprilie 2022 17:39:29 | |
---|---|---|---|
Problema | Heapuri | Status | done |
Runda | Arhiva educationala | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In function 'int main()':
main.cpp:31:66: error: no matching function for call to 'find(std::__cxx11::list<int>::iterator, std::__cxx11::list<int>::iterator, int&)'
31 | lista1.erase(find(lista1.begin(), lista1.end(), b));
| ^
In file included from /usr/include/c++/10/bits/locale_facets.h:48,
from /usr/include/c++/10/bits/basic_ios.h:37,
from /usr/include/c++/10/ios:44,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from main.cpp:1:
/usr/include/c++/10/bits/streambuf_iterator.h:422:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&)'
422 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/10/bits/streambuf_iterator.h:422:5: note: template argument deduction/substitution failed:
main.cpp:31:66: note: 'std::_List_iterator<int>' is not derived from 'std::istreambuf_iterator<_CharT>'
31 | lista1.erase(find(lista1.begin(), lista1.end(), b));
| ^
main.cpp:32:30: error: no matching function for call to 'std::__cxx11::list<int>::erase(int&)'
32 | lista.erase(b);
| ^
In file included from /usr/include/c++/10/list:64,
from main.cpp:4:
/usr/include/c++/10/bits/list.tcc:150:5: note: candidate: 'std::__cxx11::list<_Tp, _Alloc>::iterator std::__cxx11::list<_Tp, _Alloc>::erase(std::__cxx11::list<_Tp, _Alloc>::const_iterator) [with _Tp = int; _Alloc = std::allocator<int>; std::__cxx11::list<_Tp, _Alloc>::iterator = std::__cxx11::list<int>::iterator; std::__cxx11::list<_Tp, _Alloc>::const_iterator = std::__cxx11::list<int>::const_iterator]'
150 | list<_Tp, _Alloc>::
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/list.tcc:152:26: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::list<int>::const_iterator'
152 | erase(const_iterator __position) noexcept
| ~~~~~~~~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/10/list:63,
from main.cpp:4:
/usr/include/c++/10/bits/stl_list.h:1456:7: note: candidate: 'std::__cxx11::list<_Tp, _Alloc>::iterator std::__cxx11::list<_Tp, _Alloc>::erase(std::__cxx11::list<_Tp, _Alloc>::const_iterator, std::__cxx11::list<_Tp, _Alloc>::const_iterator) [with _Tp = int; _Alloc = std::allocator<int>; std::__cxx11::list<_Tp, _Alloc>::iterator = std::__cxx11::list<int>::iterator; std::__cxx11::list<_Tp, _Alloc>::const_iterator = std::__cxx11::list<int>::const_iterator]'
1456 | erase(const_iterator __first, const_iterator __last) noexcept
| ^~~~~
/usr/include/c++/10/bits/stl_list.h:1456:7: note: candidate expects 2 arguments, 1 provided
main.cpp:13:11: warning: unused variable 'nr' [-Wunused-variable]
13 | int n,nr=0;
| ^~
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !