将 using namespace 写在函数体中,以避免命名空间冲突

将 using namespace xxx 写在函数体中时, 命名空间 xxx 中定义的资源只在该函数体中有效。

测试代码如下图所示(namespace std 只在函数 testFun2 中有效):

原文地址:https://www.cnblogs.com/dhqy/p/11459806.html