Previously I noticed that GCC has built-in support for 128-bit integer. now I'm trying it under MinGW but there are two problems with that:
- I can't print it using
cout
. - I can't convert it to
string
neither bystring
's constructor nor by functions liketo_string()
.
here is the code:
#include <iostream>
using namespace std;
int main() {
__int128 a = 12;
cout << a;
return 0;
}
Use of overloaded operator '<<' is ambiguous (with operand types 'std::ostream' (aka 'basic_ostream<char>') and '__int128')
My guess is to overload <<
operator for cout... but I don't know how?!
Also why cout doesn't have support for __int128
when this is a built-in type?!