记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:19:46: error: conversion from 'std::unordered_map<int, int>::iterator {aka std::__detail::_Node_iterator<std::pair<const int, int>, false, false>}' to non-scalar type 'std::map<int, int>::iterator {aka std::_Rb_tree_iterator<std::pair<const int, int> >}' requested
   for( map<int, int>::iterator iter = s.begin(); iter != s.end(); ++iter) 
                                       ~~~~~~~^~
/in/foo.cc:19:55: error: no match for 'operator!=' (operand types are 'std::map<int, int>::iterator {aka std::_Rb_tree_iterator<std::pair<const int, int> >}' and 'std::unordered_map<int, int>::iterator {aka std::__detail::_Node_iterator<std::pair<const int, int>, false, false>}')
   for( map<int, int>::iterator iter = s.begin(); iter != s.end(); ++iter) 
                                                  ~~~~~^~~~~~~~~~
In file included from /usr/include/c++/7/map:60:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:81,
                 from /in/foo.cc:1:
/usr/include/c++/7/bits/stl_tree.h:319:7: note: candidate: bool std::_Rb_tree_iterator<_Tp>::operator!=(const _Self&) const [with _Tp = std::pair<const int, int>; std::_Rb_tree_iterator<_Tp>::_Self = std::_Rb_tree_iterator<std::pair<const int, int> >]
       operator!=(const _Self& __x) const _GLIBCXX_NOEXCEPT
       ^~~~~~~~
/usr/include/c++/7/bits/stl_tree.h:319:7: note:   no known conversion for argument 1 from 'std::unordered_map<int, int>::iterator {aka std::__detail::_Node_iterator<std::pair<const int, int>, false, false>}' to 'const _Self& {aka const std::_Rb_tree_iterator<std::pair<const int, int> >&}'
In file included from /usr/include/c++/7/regex:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110,
                 from /in/foo.cc:1:
/usr/include/c++/7/bits/regex.h:953:5: note: candidate: template<class _BiIter> bool std::__cxx11::operator!=(const std::__cxx11::sub_match<_BiIter>&, const std::__cxx11::sub_match<_BiIter>&)
     operator!=(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
     ^~~~~~~~
/usr/include/c++/7/bits/regex.h:953:5: note:   template argument deduction/substitution failed:
/in/foo.cc:19:64: note:   'std::map<int, int>::iterator {aka std::_Rb_tree_iterator<std::pair<const int, int> >}' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   for( map<int, int>::iterator iter = s.begin(); iter != s.end(); ++iter) 
                                                                ^
In file included from /usr/include/c++/7/regex:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110,
                 from /in/foo.cc:1:
/usr/include/c++/7/bits/regex.h:1031:5: note: candidate: template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator!=(std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const std::__cxx11::sub_match<_BiIter>&)
     operator!=(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/regex.h:1031:5: note:   template argument deduction/substitution failed:
/in/foo.cc:19:64: note:   'std::map<int, int>::iterator {aka std::_Rb_tree_iterator<std::pair<const int, int> >}' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
   for( map<int, int>::iterator iter = s.begin(); iter != s.end(); ++iter) 
                                                                ^
In file included from /usr/include/c++/7/regex:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110,
                 from /in/foo.cc:1:
/usr/include/c++/7/bits/regex.h:1111:5: note: candidate: template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator!=(const std::__cxx11::sub_match<_BiIter>&, std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)
     operator!=(const sub_match<_Bi_iter>& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/regex.h:1111:5: note:   template argument deduction/substitution failed:
/in/foo.cc:19:64: note:   'std::map<int, int>::iterator {aka std::_Rb_tree_iterator<std::pair<const int, int> >}' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   for( map<int, int>::iterator iter = s.begin(); iter != s.end(); ++iter) 
                                                                ^
In file included from /usr/include/c++/7/regex:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110,
                 from /in/foo.cc:1:
/usr/include/c++/7/bits/regex.h:1188:5: note: candidate: template<class _Bi_iter> bool std::__cxx11::operator!=(const typename std::iterator_traits<_Iter>::value_type*, const std::__cxx11::sub_match<_BiIter>&)
     operator!=(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/regex.h:1188:5: note:   template argument deduction/substitution failed:
/in/foo.cc:19:64: note:   'std::unordered_map<int, int>::iterator {aka std::__detail::_Node_iterator<std::pair<const int, int>, false, false>}' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   for( map<int, int>::iterator iter = s.begin(); iter != s.end(); ++iter) 
                                                                ^
In file included from /usr/include/c++/7/regex:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110,
                 from /in/foo.cc:1:
/usr/include/c++/7/bits/regex.h:1262:5: note: candidate: template<class _Bi_iter> bool std::__cxx11::operator!=(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)
     operator!=(const sub_match<_Bi_iter>& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/regex.h:1262:5: note:   template argument deduction/substitution failed:
/in/foo.cc:19:64: note:   'std::map<int, int>::iterator {aka std::_Rb_tree_iterator<std::pair<const int, int> >}' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   for( map<int, int>::iterator iter = s.begin(); iter != s.end(); ++iter) 
                                                                ^
In file included from /usr/include/c++/7/regex:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110,
                 from /in/foo.cc:1:
/usr/include/c++/7/bits/regex.h:1339:5: note: candidate: template<class _Bi_iter> bool std::__cxx11::operator!=(const typename std::iterator_traits<_Iter>::value_type&, const std::__cxx11::sub_match<_BiIter>&)
     operator!=(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/regex.h:1339:5: note:   template argument deduction/substitution failed:
/in/foo.cc:19:64: note:   'std::unordered_map<int, int>::iterator {aka std::__detail::_Node_iterator<std::pair<const int, int>, false, false>}' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   for( map<int, int>::iterator iter = s.begin(); iter != s.end(); ++iter) 
                                                                ^
In file included from /usr/include/c++/7/regex:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110,
                 from /in/foo.cc:1:
/usr/include/c++/7/bits/regex.h:1419:5: note: candidate: template<class _Bi_iter> bool std::__cxx11::operator!=(const std::__cxx11::sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)
     operator!=(const sub_match<_Bi_iter>& __lhs,
     ^~~~~~~~
/usr/include/c++/7/bits/regex.h:1419:5: note:   template argument deduction/substitution failed:
/in/foo.cc:19:64: note:   'std::map<int, int>::iterator {aka std::_Rb_tree_iterator<std::pair<const int, int> >}' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   for( map<int, int>::iterator iter = s.begin(); iter != s.end(); ++iter) 
                                                                ^
In file included from /usr/include/c++/7/regex:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:110,
                 from /in/foo.cc:1:
/usr/include/c++/7/bits/regex.h:1946:5: note: candidate: template<class _Bi_iter, class _Alloc> bool std::__cxx11::ope

信息

递交者
类型
递交
题目
wyy的烦恼
题目数据
下载
语言
C++
递交时间
2018-10-25 13:24:21
评测时间
2018-10-25 13:24:21
评测机
分数
0
总耗时
1179ms
峰值内存
139.602 MiB