Ambiguous call to overloaded function - std::to_string [duplicate]

不羁岁月 提交于 2019-12-01 02:49:14

MSVC11 lacks the proper overloads for std::to_string so you have to do a static_cast to unsigned long long or long long

Note that this bug is fixed in the November CTP 2012. Which you can get here.

temp_int is a int value, and Visual Studio seems to detect only overloads which receive either double, long long or unsigned long long values, so it doesn't know which overload to use, thus the ambiguity (although it would seem intuitive to cast integer to long values)

Either declare temp_int as a long long, or cast it when invoking the function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!