Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
就像我使用 VS2010 的主题一样:
我有:
std::string s = std::to_string(42);
和错误
Error 4 error C2668: 'std::to_string' : ambiguous call to overloaded function
如何修复它?
Visual C++ 2010 只有三个用于std::to_stringtake long long、unsigned long long和long double. 该标准定义了更多,但 VC++ 2010 不支持它们。最好不要从int文字42进行转换,因此调用是模棱两可的。相反,您可以使用不同类型的整数文字。例如:
std::to_string
long long
unsigned long long
long double
int
42
std::string s = std::to_string(42LL);
html 并替换为文本框