using x::y; - why is this not allowed?

1
2
3
4
5
6
7
8
9
10
11
12
13
namespace x
{
    namespace y
    {
        void z(){}
    }
}
 
int main()
{
    using x::y; //error
    y::z();
}
Why is this not allowed? It seems so useful and so simple...
using namespace x::y;
Or namespace y = x::y;
using namespace doesn't work in my case, thanks for the namespace y = x::y; solution!
using namespace x; then you can call y::z();
It causes ambiguities because there are things in namespace x with the same names as things in the current scope, so I cannot use using namespace x;.
Topic archived. No new replies allowed.