/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int main()':
foo.cpp:38:8: error: no match for 'operator==' (operand types are 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' and 'char')
   if(cm=='M')
      ~~^~~~~
In file included from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/iosfwd:40:0,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ios:38,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ostream:38,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/iostream:39,
                 from foo.cpp:1:
C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/postypes.h:216:5: note: candidate: template<class _StateT> bool std::operator==(const std::fpos<_StateT>&, const std::fpos<_StateT>&)
     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
     ^~~~~~~~
C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/postypes.h:216:5: note:   template argument deduction/substitution failed:
foo.cpp:38:10: note:   'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' is not derived from 'const std::fpos<_StateT>'
   if(cm=='M')
          ^~~
In file included from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/stl_algobase.h:64:0,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/char_traits.h:39,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ios:40,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ostream:38,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/iostream:39,
                 from foo.cpp:1:
C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/stl_pair.h:431: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)
     ^~~~~~~~
C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/stl_pair.h:431:5: note:   template argument deduction/substitution failed:
foo.cpp:38:10: note:   'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' is not derived from 'const std::pair<_T1, _T2>'
   if(cm=='M')
          ^~~
In file included from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/stl_algobase.h:67:0,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/char_traits.h:39,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ios:40,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ostream:38,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/iostream:39,
                 from foo.cpp:1:
C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/stl_iterator.h:292: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,
     ^~~~~~~~
C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/stl_iterator.h:292:5: note:   template argument deduction/substitution failed:
foo.cpp:38:10: note:   'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' is not derived from 'const std::reverse_iterator<_Iterator>'
   if(cm=='M')
          ^~~
In file included from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/stl_algobase.h:67:0,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/char_traits.h:39,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ios:40,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ostream:38,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/iostream:39,
                 from foo.cpp:1:
C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/stl_iterator.h:349:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator==(const std::reverse_iterator<_Iterato

信息

递交者
类型
递交
题目
P1443 银河英雄传说
语言
C++
递交时间
2017-02-22 15:48:20
评测时间
2017-02-22 15:48:20
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes