gpt4 book ai didi

c++ - std::wstring to_wstring(双值);

转载 作者:搜寻专家 更新时间:2023-10-31 00:17:01 26 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
std::to_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 Studio 2010 中编译时出现此错误

Error 1 error C2668: 'std::to_wstring' : ambiguous call to overloadedfunction 6

1> error C2668:'std::to_string' : ambiguous call to overloaded function

1> d:\program files (x86)\microsoft visual studio10.0\vc\include\string(688): could be 'std::string std::to_string(long double)'

1> d:\program files (x86)\microsoft visual studio10.0\vc\include\string(680): or 'std::string std::to_string(_ULonglong)'

1> d:\program files(x86)\microsoft visual studio 10.0\vc\include\string(672): or
'std::string std::to_string(_Longlong)'

有人可以向我解释为什么编译器会混淆以及我做错了什么吗?

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com