Visual C++ 2010 has only three overloads for std::to_string
that take long long
, unsigned long long
, and long double
. The standard defines more than that, but VC++ 2010 doesn't support them. No conversion from the int
literal 42
is preferred, so the call is ambiguous. Instead, you can use a different type of integer literal. For example:
std::string s = std::to_string(42LL);