namespace MyNamespace
{
static void foo1()
{
}
}
using namespace MyNamespace;
class MyClass
{
void foo2()
{
::foo1();
}
};
The scope resolution operation :: means using method in the global namespace. Here we can use ::foo1(). This means method foo1() is in the global namespace, am I right?
My question is, does using namespace ANAMESPACE_NAME mean we import all elements form the namespace ANAMESPACE_NAME into the global namespace?
Section 3.4.3.4 of the C++2003 standard has an answer:
This paragraph is almost identical in the C++11 FDIS, so this probably also holds in C++11.