可能重复: string - more than instance of overloaded function matches the argument list
#include <string>
int main()
{
double randDouble = 1245.432;
std::wstring stringDouble = std::to_wstring(randDouble);
}当我在Visual 2010中编译它时,我会得到以下错误
错误1错误C2668:'std::to_wstring‘:对重载函数6的模糊调用 1> error C2668:'std::to_string‘:对重载函数的模糊调用 1> d:\程序文件(x86)\microsoft 10.0\vc\include\string(688):可能是'std::string std::to_string(长双)‘ 1> d:\程序文件(x86)\microsoft 10.0\vc\include\string(680):或'std::string std::to_string(_ULonglong)‘ 1> d:\程序文件(X86)\ 10.0\vc\include\string(672):或 ‘'std::string std::to_string(_Longlong)’
有谁能给我解释一下为什么编译器混淆了,我做错了什么?
发布于 2013-01-27 01:15:31
这是VisualC++ 2010中的一个bug。它已经在2012年的视觉C++中修复了。
https://stackoverflow.com/questions/14543402
复制相似问题