If you try to pass an __int64 variable to the ostream operator <<, you get the following error:
error C2593: 'operator <<' is ambiguous
Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.
//Sample.cpp
// Compiler Options : /GX
//#define WORKAROUND //Uncomment this line to workaround
#include<iostream>
using namespace std;
#ifdef WORKAROUND
std::ostream& operator<<(std::ostream& os, __int64 i )
{
char buf[20];
sprintf(buf,"%I64d", i );
os << buf;
return os;
}
#endif
int main(){
__int64 i64;
cout << i64 ;
return 0;
}
Keywords: kbvc600applies, kbvc600wrapup, kbbug, kbcrt, kbdsupport, kberrmsg, kbfix, kbnoupdate, kbbillprodsweep, kb