std::to_string尽管使用了using指令,编译器仍然看不到该函数.这是为什么?
#include <string>
namespace MySpace
{
using namespace std;
struct X
{
int n;
};
string to_string(X x)
{
return to_string(x.n);//Error here
}
}
Run Code Online (Sandbox Code Playgroud)
如果我把东西移出MySpace全局命名空间,或者我明确地添加using std::to_string;声明,那么一切正常MySpace.