记录详情

Compile Error

foo.cc:4:19: error: no matching function for call to 'std::basic_ifstream<char>::basic_ifstream(_IO_FILE*&)'
 ifstream fin(stdin);
                   ^
In file included from foo.cc:1:0:
/usr/include/c++/7/fstream:521:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(std::basic_ifstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]
       basic_ifstream(basic_ifstream&& __rhs)
       ^~~~~~~~~~~~~~
/usr/include/c++/7/fstream:521:7: note:   no known conversion for argument 1 from '_IO_FILE*' to 'std::basic_ifstream<char>&&'
/usr/include/c++/7/fstream:511:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::__cxx11::string = std::__cxx11::basic_string<char>; std::ios_base::openmode = std::_Ios_Openmode]
       basic_ifstream(const std::string& __s,
       ^~~~~~~~~~~~~~
/usr/include/c++/7/fstream:511:7: note:   no known conversion for argument 1 from '_IO_FILE*' to 'const string& {aka const std::__cxx11::basic_string<char>&}'
/usr/include/c++/7/fstream:495:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
       basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
       ^~~~~~~~~~~~~~
/usr/include/c++/7/fstream:495:7: note:   no known conversion for argument 1 from '_IO_FILE*' to 'const char*'
/usr/include/c++/7/fstream:481:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits<char>]
       basic_ifstream() : __istream_type(), _M_filebuf()
       ^~~~~~~~~~~~~~
/usr/include/c++/7/fstream:481:7: note:   candidate expects 0 arguments, 1 provided
foo.cc:5:21: error: no matching function for call to 'std::basic_ofstream<char>::basic_ofstream(_IO_FILE*&)'
 ofstream fout(stdout);
                     ^
In file included from foo.cc:1:0:
/usr/include/c++/7/fstream:725:7: note: candidate: std::basic_ofstream<_CharT, _Traits>::basic_ofstream(std::basic_ofstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]
       basic_ofstream(basic_ofstream&& __rhs)
       ^~~~~~~~~~~~~~
/usr/include/c++/7/fstream:725:7: note:   no known conversion for argument 1 from '_IO_FILE*' to 'std::basic_ofstream<char>&&'
/usr/include/c++/7/fstream:715:7: note: candidate: std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::__cxx11::string = std::__cxx11::basic_string<char>; std::ios_base::openmode = std::_Ios_Openmode]
       basic_ofstream(const std::string& __s,
       ^~~~~~~~~~~~~~
/usr/include/c++/7/fstream:715:7: note:   no known conversion for argument 1 from '_IO_FILE*' to 'const string& {aka const std::__cxx11::basic_string<char>&}'
/usr/include/c++/7/fstream:697:7: note: candidate: std::basic_ofstream<_CharT, _Traits>::basic_ofstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
       basic_ofstream(const char* __s,
       ^~~~~~~~~~~~~~
/usr/include/c++/7/fstream:697:7: note:   no known conversion for argument 1 from '_IO_FILE*' to 'const char*'
/usr/include/c++/7/fstream:682:7: note: candidate: std::basic_ofstream<_CharT, _Traits>::basic_ofstream() [with _CharT = char; _Traits = std::char_traits<char>]
       basic_ofstream(): __ostream_type(), _M_filebuf()
       ^~~~~~~~~~~~~~
/usr/include/c++/7/fstream:682:7: note:   candidate expects 0 arguments, 1 provided
Found 6 testcases.
自豪的采用HydroJudge(https://github.com/hydro-dev/Hydro)进行评测。

信息

递交者
类型
递交
题目
P1026 数对 pair
语言
C++
递交时间
2021-04-10 15:32:04
评测时间
2021-04-10 15:32:04
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes