65,206
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <sstream>
using namespace std;
int main() {
int64_t nUserID = 0x887766;
std::stringstream ssUserID;
ssUserID << nUserID;
cout << ssUserID.str() << endl;
return 0;
}
16:19:24 **** Rebuild of configuration Debug for project strict_ansi_test ****
Info: Internal Builder is used for build
g++ -std=c++11 -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\strict_ansi_test.o" "..\\src\\strict_ansi_test.cpp"
g++ -o strict_ansi_test.exe "src\\strict_ansi_test.o"
16:19:25 Build Finished (took 1s.233ms)
#include <sstream>
using namespace std;
using int64 = long long;
int main ()
{
int64 i;
stringstream ss;
ss << i;
}
看错误信息,存在自定义 << 重载干扰解析。编译器一般会说候选函数是什么,找找那个在捣乱。