关于c++的命名空间

using namespace std;
namespace name1 {
void func()
{

     cout << "Hello1" << endl;
}

}

namespace name2 {
void func()
{

     cout << "Hello2" << endl;
}

}
namespace  {
void func1()
{

     cout << "Hello2" << endl;
}//由于此函数是无名命名空间,所以此函数只能在此命名空间里面使用,这种用法一般很少

}
using namespace name2;
int main()
{
    func();
    return 0;
}
原文地址:https://www.cnblogs.com/tiantiantian-dianzi/p/5988242.html