首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >std::wstring to_wstring(双值);

std::wstring to_wstring(双值);
EN

Stack Overflow用户
提问于 2013-01-27 01:06:07
回答 1查看 1.9K关注 0票数 2

可能重复: string - more than instance of overloaded function matches the argument list

代码语言:javascript
复制
#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)’

有谁能给我解释一下为什么编译器混淆了,我做错了什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-01-27 01:15:31

这是VisualC++ 2010中的一个bug。它已经在2012年的视觉C++中修复了。

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14543402

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档