重载函数to_string的多个实例与参数列表匹配
More than one instance of overloaded function to_string matches the argument list
我完全按照这里写的做了:在C++中将 int 转换为字符串的最简单方法
但是我在 std::to_string 的标准处出现错误
#include <iostream>
#include <string>
int main()
{
std::string s = std::to_string(42);
return 0;
}
无法为符合标准的库实现生成收到的错误消息。
因此,最好的解决方案是升级编译器(大概是几年前的Visual C++)。
另一种方法是使用类型 long
的参数,并希望这是现有的重载之一:
std::to_string( 42L )
相关文章:
- 错误 没有与参数列表匹配的重载函数"getline"实例
- 将可变参数函数的参数封装在类实例中
- 在 c++ 中的模板实例化中使用带有构造函数的类作为类型参数
- std::vector 没有重载函数的实例与参数列表匹配
- 如果模板参数是另一个模板的实例化,则键入特征测试
- 如何在模板函数中实例化其长度使用模板参数的数组
- 函数在可变参数模板的实例化期间不可见
- 有什么方法可以将具有不同模板参数的模板类实例放入向量中?
- 实例化模板时,我是否必须显式显示参数包中的类型?
- "extern"声明以及带有和不带参数列表的类模板实例的后续定义
- 如何使用参数声明实例?
- 没有函数模板的实例与我不知道为什么的参数列表匹配
- 结构数组的构造函数错误,错误消息:没有构造函数实例与参数列表匹配
- 从模板参数包实例化的访问类实现
- C++ 可变参数模板实例化深度超过最大值 900
- 特征实例作为不同特征的模板参数
- 与参数匹配的友元模板函数实例化
- 有没有办法根据命令行参数定义数组大小?运行时与编译时实例化?
- c++ STL容器.为每个不同的实例参数化比较器
- 带有新实例参数的c++ 11委托构造函数