/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:23:32: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and 'int')
   23 |         cout<<strcmp(str1,str2)<0?"less":"more";
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~
      |             |                   |
      |             |                   int
      |             std::basic_ostream<char>
/in/foo.cc:23:32: note: candidate: 'operator<(int, int)' (built-in)
   23 |         cout<<strcmp(str1,str2)<0?"less":"more";
      |         ~~~~~~~~~~~~~~~~~~~~~~~^~
/in/foo.cc:23:32: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
In file included from /usr/include/c++/12/string:47,
                 from /usr/include/c++/12/bits/locale_classes.h:40,
                 from /usr/include/c++/12/bits/ios_base.h:41,
                 from /usr/include/c++/12/ios:42,
                 from /usr/include/c++/12/ostream:38,
                 from /usr/include/c++/12/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/12/bits/stl_iterator.h:451:5: note: candidate: 'template<class _Iterator> bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  451 |     operator<(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:451:5: note:   template argument deduction/substitution failed:
/in/foo.cc:23:33: note:   'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
   23 |         cout<<strcmp(str1,str2)<0?"less":"more";
      |                                 ^
/usr/include/c++/12/bits/stl_iterator.h:496:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  496 |     operator<(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:496:5: note:   template argument deduction/substitution failed:
/in/foo.cc:23:33: note:   'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
   23 |         cout<<strcmp(str1,str2)<0?"less":"more";
      |                                 ^
/usr/include/c++/12/bits/stl_iterator.h:1683:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1683 |     operator<(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:1683:5: note:   template argument deduction/substitution failed:
/in/foo.cc:23:33: note:   'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
   23 |         cout<<strcmp(str1,str2)<0?"less":"more";
      |                                 ^
/usr/include/c++/12/bits/stl_iterator.h:1748:5: note: candidate: 'template<class _Iterator> bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
 1748 |     operator<(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:1748:5: note:   template argument deduction/substitution failed:
/in/foo.cc:23:33: note:   'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
   23 |         cout<<strcmp(str1,str2)<0?"less":"more";
      |                                 ^
In file included from /usr/include/c++/12/bits/stl_algobase.h:64,
                 from /usr/include/c++/12/string:50:
/usr/include/c++/12/bits/stl_pair.h:663:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
  663 |     operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_pair.h:663:5: note:   template argument deduction/substitution failed:
/in/foo.cc:23:33: note:   'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
   23 |         cout<<strcmp(str1,str2)<0?"less":"more";
      |                                 ^
In file included from /usr/include/c++/12/string:53:
/usr/include/c++/12/bits/basic_string.h:3691:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
 3691 |     operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/basic_string.h:3691:5: note:   template argument deduction/substitution failed:
/in/foo.cc:23:33: note:   'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
   23 |         cout<<strcmp(str1,str2)<0?"less":"more";
      |                                 ^
/usr/include/c++/12/bits/basic_string.h:3704:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)'
 3704 |     operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/basic_string.h:3704:5: note:   template argument deduction/substitution failed:
/in/foo.cc:23:33: note:   'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
   23 |         cout<<strcmp(str1,str2)<0?"less":"more";
      |                                 ^
/usr/include/c++/12/bits/basic_string.h:3716:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
 3716 |     operator<(const _CharT* __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/basic_string.h:3716:5: note:   template argument deduction/substitution failed:
/in/foo.cc:23:33: note:   mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
   23 |         cout<<strcmp(str1,str2)<0?"less":"more";
      |                                 ^
In file included from /usr/include/c++/12/bits/ios_base.h:46:
/usr/include/c++/12/system_error:269:3: note: candidate: 'bool std::operator<(const error_code&, const error_code&)'
  269 |   operator<(const error_code& __lhs, const error_code& __rhs) noexcept
      |   ^~~~~~~~
/usr/include/c++/12/system_error:269:31: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_code&'
  269 |   operator<(const error_code& __lhs, const error_code& __rhs) noexcept
      |             ~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/12/system_error:398:3: note: candidate: 'bool std::operator<(const error_condition&, const error_condition&)'
  398 |   operator<(const error_condition& __lhs,
      |   ^~~~~~~~
/usr/include/c++/12/system_error:398:36: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_condition&'
  398 |   operator<(const error_condition& __lhs,
      |             ~~~~~~~~~~~~~~~~~~~~~~~^~~~~

信息

递交者
类型
自测
题目
P1004 伊甸园日历游戏
语言
C++
递交时间
2025-04-23 14:43:14
评测时间
2025-04-23 14:43:14
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes