记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:31:21: error: expected ')' before '_'
  for(int i=0;i<n;i++_
                     ^
/in/foo.cc:31:21: error: '_' was not declared in this scope
/in/foo.cc:40:17: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   cout<<(temp.id<<endl;
          ~~~~~~~^~~~~~
/in/foo.cc:40:23: error: expected ')' before ';' token
   cout<<(temp.id<<endl;
                       ^
/in/foo.cc:30:6: warning: unused variable 'tempa' [-Wunused-variable]
  int tempa,tempb;
      ^~~~~
/in/foo.cc:30:12: warning: unused variable 'tempb' [-Wunused-variable]
  int tempa,tempb;
            ^~~~~
In file included from /usr/include/c++/6/string:48:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_function.h: In instantiation of 'bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = Work]':
/usr/include/c++/6/bits/stl_tree.h:1836:11:   required from 'std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_unique_pos(const key_type&) [with _Key = Work; _Val = Work; _KeyOfValue = std::_Identity<Work>; _Compare = std::less<Work>; _Alloc = std::allocator<Work>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::key_type = Work]'
/usr/include/c++/6/bits/stl_tree.h:1889:28:   required from 'std::pair<std::_Rb_tree_iterator<_Val>, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg&&) [with _Arg = Work; _Key = Work; _Val = Work; _KeyOfValue = std::_Identity<Work>; _Compare = std::less<Work>; _Alloc = std::allocator<Work>]'
/usr/include/c++/6/bits/stl_set.h:492:40:   required from 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::value_type&&) [with _Key = Work; _Compare = std::less<Work>; _Alloc = std::allocator<Work>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree_const_iterator<Work>; std::set<_Key, _Compare, _Alloc>::value_type = Work]'
/in/foo.cc:41:59:   required from here
/usr/include/c++/6/bits/stl_function.h:386:20: error: no match for 'operator<' (operand types are 'const Work' and 'const Work')
       { return __x < __y; }
                ~~~~^~~~~
/in/foo.cc:16:7: note: candidate: bool Work::operator<(Work&) <near match>
  bool operator < (Work &w)
       ^~~~~~~~
/in/foo.cc:16:7: note:   conversion of argument 1 would be ill-formed:
In file included from /usr/include/c++/6/string:48:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_function.h:386:20: error: binding 'const Work' to reference of type 'Work&' discards qualifiers
       { return __x < __y; }
                ~~~~^~~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_pair.h:441:5: note: candidate: template<class _T1, class _T2> constexpr bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
     operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
     ^~~~~~~~
/usr/include/c++/6/bits/stl_pair.h:441:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/string:48:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_function.h:386:20: note:   'const Work' is not derived from 'const std::pair<_T1, _T2>'
       { return __x < __y; }
                ~~~~^~~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator.h:298:5: note: candidate: template<class _Iterator> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
     operator<(const reverse_iterator<_Iterator>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:298:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/string:48:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_function.h:386:20: note:   'const Work' is not derived from 'const std::reverse_iterator<_Iterator>'
       { return __x < __y; }
                ~~~~^~~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator.h:355:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator<(const reverse_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:355:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/string:48:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_function.h:386:20: note:   'const Work' is not derived from 'const std::reverse_iterator<_Iterator>'
       { return __x < __y; }
                ~~~~^~~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator.h:1137:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator<(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
     operator<(const move_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/6/bits/stl_iterator.h:1137:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/string:48:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /

信息

递交者
类型
自测
题目
大柱的任务系统
语言
C++
递交时间
2018-02-04 14:33:46
评测时间
2018-02-04 14:33:46
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes