Cause
There is no operator << for __int64 type defined for the ostream class.
Resolution
Define your own version of operator <<. The following sample code section shows a simple solution for << operator that converts the __int64 variable to a char * type and passes it to the ostream << operator.
The following sample program demonstrates the problem and 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;
}
Reference:
"error C2593: 'operator <<' is ambiguous"[
^]