c++11/14 make_unique ambigious overload for std::string

自闭症网瘾萝莉.ら 提交于 2019-12-05 06:14:49

The call is ambiguous because you do have std::make_unique, as shown by the tooltip contents you quote. And even though you did not write std::, since you are passing a std::string argument-dependent lookup kicks in to search that namespace automatically.

When you say "I am using C++11", that's not quite right, because Visual Studio doesn't let you choose which standard to write in. It just provides you with the latest support it has mustered for any given feature. And, apparently, Visual Studio 2013 has C++14's std::make_unique.

Remove yours.

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