/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int main()':
foo.cpp:5:21: error: no match for 'operator+' in 'std::cin + std::cin'
foo.cpp:5:21: note: candidates are:
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/stl_algobase.h:68:0,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/char_traits.h:41,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ios:41,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:40,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/iostream:40,
                 from foo.cpp:1:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/stl_iterator.h:335:5: note: template<class _Iterator> std::reverse_iterator<_Iterator> std::operator+(typename std::reverse_iterator<_Iterator>::difference_type, const std::reverse_iterator<_Iterator>&)
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/stl_iterator.h:335:5: note:   template argument deduction/substitution failed:
foo.cpp:5:21: note:   'std::istream {aka std::basic_istream<char>}' is not derived from 'const std::reverse_iterator<_Iterator>'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/string:54:0,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/locale_classes.h:42,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/ios_base.h:43,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ios:43,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:40,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/iostream:40,
                 from foo.cpp:1:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/basic_string.h:2362:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, const std::basic_string<_CharT, _Traits, _Alloc>&)
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/basic_string.h:2362:5: note:   template argument deduction/substitution failed:
foo.cpp:5:21: note:   'std::istream {aka std::basic_istream<char>}' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/string:55:0,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/locale_classes.h:42,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/ios_base.h:43,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ios:43,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:40,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/iostream:40,
                 from foo.cpp:1:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/basic_string.tcc:694:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const _CharT*, const std::basic_string<_CharT, _Traits, _Alloc>&)
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/basic_string.tcc:694:5: note:   template argument deduction/substitution failed:
foo.cpp:5:21: note:   mismatched types 'const _CharT*' and 'std::basic_istream<char>'
In file included from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/string:55:0,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/locale_classes.h:42,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/ios_base.h:43,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ios:43,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/ostream:40,
                 from c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/iostream:40,
                 from foo.cpp:1:
c:\mingw32\bin\../lib/gcc/mingw32/4.7.1/include/c++/bits/basic_string.tcc:710:5: note: template<class _CharT, class _Traits, class _Alloc

信息

递交者
类型
递交
题目
P1000 A+B Problem
语言
C++
递交时间
2014-12-25 17:24:55
评测时间
2014-12-25 17:24:56
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes