Hi,
I'm trying to understand why this program does not give an name-lookup ambiguity for i;
namespace X { int i = 1; }
namespace Q {
namespace P {
int i = 2;
using namespace X;
}
using namespace P;
int l = i;
}
int main() {}
If me modify it like this we get a name-lookup ambiguity:
namespace X { int i = 1; }
namespace P {
int i = 2;
using namespace X;
}
using namespace P;
int l = i;
int main() {}
The only change I made here is to remove the namespace Q and place it's content in the global namespace instead.
Can anyone explain the behaviour in terms of the c++ standard? I fail to understand it.