Roman Blog
Покажешь сравнение?
file.cpp: In function ‘int main()’:
file.cpp:7:13: error: no matching function for call to ‘std::set<std::pair<int, int> >::find(int)’
7 | s.find(5);
| ^
In file included from /usr/include/c++/9/set:61,
from file.cpp:1:
/usr/include/c++/9/bits/stl_set.h:794:7: note: candidate: ‘std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::find(const key_type&) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree_const_iterator<std::pair<int, int> >; std::set<_Key, _Compare, _Alloc>::key_type = std::pair<int, int>]’
794 | find(const key_type& __x)
| ^~~~
/usr/include/c++/9/bits/stl_set.h:794:28: note: no known conversion for argument 1 from ‘int’ to ‘const key_type&’ {aka ‘const std::pair<int, int>&’}
794 | find(const key_type& __x)
| ~~~~~~~~~~~~~~^
/usr/include/c++/9/bits/stl_set.h:798:7: note: candidate: ‘std::set<_Key, _Compare, _Alloc>::const_iterator std::set<_Key, _Compare, _Alloc>::find(const key_type&) const [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree_const_iterator<std::pair<int, int> >; std::set<_Key, _Compare, _Alloc>::key_type = std::pair<int, int>]’
798 | find(const key_type& __x) const
| ^~~~
/usr/include/c++/9/bits/stl_set.h:798:28: note: no known conversion for argument 1 from ‘int’ to ‘const key_type&’ {aka ‘const std::pair<int, int>&’}
798 | find(const key_type& __x) const
| ~~~~~~~~~~~~~~^
/usr/include/c++/9/bits/stl_set.h:804:2: note: candidate: ‘template<class _Kt> decltype (std::set<_Key, _Compare, _Alloc>::iterator{((std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_find_tr(__x)}) std::set<_Key, _Compare, _Alloc>::find(const _Kt&) [with _Kt = _Kt; _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >]’
804 | find(const _Kt& __x)
| ^~~~
/usr/include/c++/9/bits/stl_set.h:804:2: note: template argument deduction/substitution failed:
/usr/include/c++/9/bits/stl_set.h: In substitution of ‘template<class _Kt> decltype (std::set<std::pair<int, int> >::iterator{((std::set<std::pair<int, int> >*)this)->std::set<std::pair<int, int> >::_M_t.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::_M_find_tr(__x)}) std::set<std::pair<int, int> >::find<_Kt>(const _Kt&) [with _Kt = int]’:
file.cpp:7:13: required from here
/usr/include/c++/9/bits/stl_set.h:804:2: error: no matching function for call to ‘std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::_M_find_tr(const int&)’
In file included from /usr/include/c++/9/set:60,
from file.cpp:1:
/usr/include/c++/9/bits/stl_tree.h:1306:2: note: candidate: ‘template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_find_tr(const _Kt&) [with _Kt = _Kt; _Req = _Req; _Key = std::pair<int, int>; _Val = std::pair<int, int>; _KeyOfValue = std::_Identity<std::pair<int, int> >; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >]’
1306 | _M_find_tr(const _Kt& __k)
| ^~~~~~~~~~
/usr/include/c++/9/bits/stl_tree.h:1306:2: note: template argument deduction/substitution failed:
/usr/include/c++/9/bits/stl_tree.h: In substitution of ‘template<class _Cmp, class _SfinaeType> using __has_is_transparent_t = typename std::__has_is_transparent<_Cmp, _SfinaeType>::type [with _Cmp = std::less<std::pair<int, int> >; _SfinaeType = int]’: