std::wstring to_wstring( double value );
std::wstring to_wstring( double value );
可能的重复项:
std::to_string - 重载函数的多个实例与参数列表匹配
#include <string>
int main()
{
double randDouble = 1245.432;
std::wstring stringDouble = std::to_wstring(randDouble);
}
当我在Visual Studio 2010中编译它时,我收到此错误
错误1 错误 C2668:"std::to_wstring":对重载的不明确调用功能6
1>错误 C2668:'std::to_string":对重载函数的不明确调用
1> d:\Program Files (x86)\Microsoft Visual Studio10.0\vc\include\string(688): 可以是 'std::string std::to_string(long double)'
1> d:\Program Files (x86)\Microsoft Visual Studio10.0\vc\include\string(680): 或 'std::string std::to_string(_ULonglong)'
1> d:\程序文件(x86)\Microsoft Visual Studio 10.0\VC\include\string(672): or
'std::string std::to_string(_Longlong)'
有人可以向我解释为什么编译器感到困惑以及我做错了什么吗?
这是Visual C++ 2010中的一个错误。 此问题已在 Visual C++ 2012 中修复。
相关文章:
- Ctypes wstring通过引用传递
- 瓦尔格林德:数学函数"Conditional jump or move depends on uninitialised value(s)"
- 为什么static_assert错误:即使我传递常量"expression must have a constant value"?
- 在C++中将变量 wstring 分配给 Char 数组
- 为什么我会" void value not ignored as it ought to be"?
- 方法错误"not all control paths return a value"和方法不返回值
- C++/SDL "initial value of reference to a non-const must be an lvalue"
- 如何在 c++ 中理解这样的代码 [request->headers().Method()->value().getStringView())]
- std::<key-value>不同类型的对向量
- c++ visual studio 64bit | save registers value
- 将日语 wstring 转换为 std::string
- 初始化数组、"memset"或" {//value} "的最佳方法是什么?
- 如何解决类成员函数中的"return a value"错误?
- bsoncxx: document::view vs document::value
- .value( "key" , default) 不适用于空的 json 对象吗?
- 使用 memcpy 将矢量数据复制到 wstring 的正确方法
- 如何在C++中设置演员的"Render Custom Depth Pass"和"Depth Stencil Value"?
- Qt 错误:QSqlQuery::value:尝试从表中检索统计信息时未定位在有效记录上 (QComboBox)
- -fshort-wchar 和 std::wstring - 分段错误
- std::wstring to_wstring( double value );